@import url("../css-template.css");

main {
    display: flex;
    justify-content: center;
    padding: 2rem;
    padding-top: calc(56px + 2rem);
    flex: 1;
}

@media (min-width: 769px) {
    main {
        padding-left: calc(220px + 2rem);
    }
}

.profile-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.profile-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

/* Profile info rows */
.user-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-value {
    font-size: 1.05rem;
    color: var(--text);
}

.edit-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.edit-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.edit-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.edit-actions {
    display: flex;
    gap: 0.5rem;
}

.save-btn, .cancel-btn {
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.2s;
}

.save-btn {
    background-color: var(--accent);
    color: white;
}

.save-btn:hover {
    background-color: var(--accent-hover);
}

.cancel-btn {
    background-color: var(--surface-3);
    color: var(--text);
}

.cancel-btn:hover {
    background-color: var(--surface-2);
}

/* Form elements */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-muted);
}

.profile-input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
    background-color: var(--surface-2);
    color: var(--text);
    font-family: inherit;
}

.profile-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.profile-button {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.profile-button:hover {
    background-color: var(--accent-hover);
}

.profile-button.secondary {
    background-color: var(--surface-3);
    color: var(--text);
}

.profile-button.secondary:hover {
    background-color: var(--surface-2);
}

/* Status messages */
.status-message {
    padding: 1rem;
    border-radius: var(--radius);
    display: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.status-message.success {
    background-color: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
    display: block;
}

.status-message.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
    display: block;
}

/* Email preferences */
.pref-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.pref-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pref-row:first-child {
    padding-top: 0;
}

.pref-info {
    flex: 1;
    min-width: 0;
}

.pref-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}

.pref-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--surface-3);
    border-radius: 24px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Danger zone */
.danger-zone {
    border: 2px solid #dc2727;
}

.danger-zone h2 {
    color: #dc2727;
}

.danger-text {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.danger-button {
    background-color: #dc2727;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
    font-family: inherit;
}

.danger-button:hover {
    background-color: #b91c1c;
}

.danger-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 450px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #dc2727;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 1rem;
        padding-top: calc(56px + 1rem);
        padding-left: 1rem;
    }

    .profile-container {
        gap: 1.25rem;
    }

    .profile-section {
        padding: 1rem;
    }

    .profile-section h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .info-value-group {
        flex-wrap: wrap;
    }

    .info-value {
        font-size: 0.95rem;
    }

    .danger-button {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }

    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0.75rem;
        padding-top: calc(56px + 0.75rem);
    }

    .profile-section {
        padding: 0.85rem;
    }

    .profile-button {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
}
