/* Auth Pages Styles - Green Magnolia */

/* ==========================================================================
   AUTH SECTION
   ========================================================================== */

.auth-section {
    padding: 3rem 0;
    min-height: calc(100vh - 400px);
}

.auth-card {
    max-width: 450px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

/* ==========================================================================
   AUTH MESSAGES
   ========================================================================== */

.auth-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.auth-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.auth-success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* ==========================================================================
   SOCIAL LOGIN
   ========================================================================== */

.social-login {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-social:hover {
    background: #f7f7f7;
    border-color: #ccc;
}

.btn-social svg {
    flex-shrink: 0;
}

.btn-google:hover {
    border-color: #4285F4;
}

.btn-facebook:hover {
    border-color: #1877F2;
}

/* ==========================================================================
   DIVIDER
   ========================================================================== */

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #888;
    font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.auth-divider span {
    padding: 0 1rem;
}

/* ==========================================================================
   AUTH FORM
   ========================================================================== */

.auth-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: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    padding: 0.875rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color, #2d5a27);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.form-hint {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
}

/* Password Toggle */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #888;
}

.password-toggle:hover {
    color: #333;
}

.password-toggle svg {
    fill: currentColor;
}

/* Form Row */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
}

.checkbox-label a {
    color: var(--primary-color, #2d5a27);
}

/* Forgot Link */
.forgot-link {
    color: var(--primary-color, #2d5a27);
    font-size: 0.9rem;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Button Block */
.btn-block {
    width: 100%;
    padding: 1rem;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.auth-footer a {
    color: var(--primary-color, #2d5a27);
    font-weight: 500;
}

/* ==========================================================================
   PROFILE PAGE
   ========================================================================== */

.profile-section {
    padding: 2rem 0 4rem;
}

.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

/* Profile Sidebar */
.profile-sidebar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    height: fit-content;
}

.profile-avatar-section {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1.5rem;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.avatar-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color, #2d5a27);
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: var(--primary-color, #2d5a27);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.avatar-upload-btn:hover {
    transform: scale(1.1);
}

.avatar-upload-btn svg {
    fill: #fff;
}

.profile-sidebar h3 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
}

.user-email {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
    word-break: break-word;
}

.user-since {
    color: #888;
    font-size: 0.8rem;
    margin: 0;
}

/* Profile Nav */
.profile-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.profile-nav-item {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    transition: background 0.2s;
}

.profile-nav-item:hover {
    background: #f5f5f5;
}

.profile-nav-item.active {
    background: var(--primary-color, #2d5a27);
    color: #fff;
}

.logout-btn {
    margin-top: auto;
}

/* Profile Main */
.profile-main {
    min-height: 400px;
}

.profile-tab {
    display: none;
}

.profile-tab.active {
    display: block;
}

/* Profile Stats */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color, #2d5a27);
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Profile Section Card */
.profile-section-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.profile-section-card h3 {
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

/* Settings Form */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.settings-form .btn {
    width: fit-content;
}

/* Danger Zone */
.danger-zone {
    border: 1px solid #fee2e2;
}

.danger-zone h3 {
    color: #dc2626;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* User Reviews List */
.user-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-review-card {
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
}

.user-review-card .review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.user-review-card .review-rating {
    color: #f59e0b;
}

.user-review-card .review-date {
    color: #888;
    font-size: 0.85rem;
}

.user-review-card .review-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.user-review-card .review-body {
    color: #444;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.user-review-card .review-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.user-review-card .review-actions {
    display: flex;
    gap: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.empty-state a {
    color: var(--primary-color, #2d5a27);
}

/* ==========================================================================
   USER MENU (Header)
   ========================================================================== */

.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color, #2d5a27);
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    padding: 0.5rem 0;
    z-index: 100;
    display: none;
}

.user-menu.open .user-menu-dropdown {
    display: block;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
    background: #f5f5f5;
}

/* ==========================================================================
   BUTTON TEXT VARIANT
   ========================================================================== */

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color, #2d5a27);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

.btn-text:hover {
    text-decoration: underline;
}

.btn-text.btn-danger {
    color: #dc2626;
    background: none;
}

/* ==========================================================================
   RESPONSIVE - MOBILE OPTIMIZATIONS
   ========================================================================== */

/* Tablet and mobile */
@media (max-width: 768px) {
    .auth-section {
        padding: 2rem 0;
    }

    .auth-card {
        max-width: 100%;
        margin: 0 16px;
        padding: 1.75rem;
        border-radius: 10px;
    }

    /* Touch-friendly social buttons */
    .btn-social {
        min-height: 48px;
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }

    /* Touch-friendly form inputs */
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="password"] {
        min-height: 48px;
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Touch-friendly checkboxes */
    .checkbox-label input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }

    .checkbox-label {
        font-size: 0.875rem;
        line-height: 1.4;
    }

    /* Touch-friendly password toggle */
    .password-toggle {
        width: 44px;
        height: 44px;
        right: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Touch-friendly submit button */
    .btn-block {
        min-height: 52px;
        font-size: 1rem;
    }

    /* Profile layout */
    .profile-layout {
        gap: 1.5rem;
    }

    .profile-sidebar {
        padding: 1.25rem;
    }

    /* Touch-friendly profile nav */
    .profile-nav-item {
        min-height: 48px;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    /* Profile stats */
    .profile-stats {
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    /* Profile section cards */
    .profile-section-card {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }

    /* Settings form */
    .settings-form {
        max-width: 100%;
    }

    /* User avatar in header */
    .user-menu-toggle {
        width: 44px;
        height: 44px;
        padding: 4px;
    }

    .user-avatar-small {
        width: 36px;
        height: 36px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
        margin: 0 12px;
    }

    .social-login .btn-social {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .auth-divider {
        margin: 1.25rem 0;
    }

    .auth-form {
        gap: 1rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    /* Profile sidebar on small screens */
    .profile-sidebar {
        padding: 1rem;
    }

    .avatar-image {
        width: 80px;
        height: 80px;
    }

    .avatar-upload-btn {
        width: 28px;
        height: 28px;
    }

    .profile-sidebar h3 {
        font-size: 1.1rem;
    }

    /* Compact profile nav */
    .profile-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .profile-nav-item {
        text-align: center;
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        border-radius: 6px;
        background: var(--bg-tertiary, #f5f5f5);
    }

    .profile-nav-item.active {
        background: var(--primary-color, #2d5a27);
    }

    /* User reviews */
    .user-review-card {
        padding: 0.875rem;
    }

    .user-review-card .review-title {
        font-size: 0.95rem;
    }

    .user-review-card .review-body {
        font-size: 0.9rem;
    }
}

/* Very small phones */
@media (max-width: 375px) {
    .auth-card {
        padding: 1.25rem;
        margin: 0 8px;
    }

    .btn-block {
        min-height: 48px;
        font-size: 0.9rem;
    }

    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-social:hover {
        background: #fff;
        border-color: #ddd;
    }

    .btn-social:active {
        background: #f0f0f0;
        transform: scale(0.98);
    }

    .profile-nav-item:hover {
        background: inherit;
    }

    .profile-nav-item:active {
        opacity: 0.8;
        transform: scale(0.98);
    }

    .form-group input:focus {
        /* Better touch feedback */
        box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.15);
    }
}
