/* Client Dashboard and Authentication Styles */

/* Sticky Header */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #d0d7de;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sticky-header.hidden {
    transform: translateY(-100%);
}

.sticky-header-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #24292f;
    transition: color 0.2s;
    text-decoration: none;
}

.header-icon-btn:hover {
    color: #0969da;
}

.header-icon-btn svg {
    width: 22px;
    height: 22px;
}

/* Auth Button Styles */
.auth-account-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #24292f;
    transition: color 0.2s;
}

.auth-account-btn:hover {
    color: #0969da;
}

.auth-account-btn svg {
    width: 20px;
    height: 20px;
}

.auth-account-btn span {
    white-space: nowrap;
}

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-modal.active {
    display: flex;
}

.auth-modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #656d76;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.2s;
}

.auth-modal-close:hover {
    color: #24292f;
}

#authModalTitle {
    margin: 0 0 24px 0;
    font-size: 24px;
    color: #24292f;
    font-weight: 600;
}

#authModalBody .form-group {
    margin-bottom: 16px;
}

#authModalBody label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #24292f;
    font-size: 14px;
}

#authModalBody input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

#authModalBody input:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

#authModalBody .submit-btn {
    width: 100%;
    padding: 12px;
    background: #24292f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

#authModalBody .submit-btn:hover:not(:disabled) {
    background: #1c2127;
}

#authModalBody .submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #656d76;
    padding-top: 16px;
    border-top: 1px solid #d0d7de;
}

.auth-switch a {
    color: #0969da;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-switch a:active {
    opacity: 0.8;
}

/* User Menu Styles */
.auth-user-menu {
    position: relative;
}

.auth-user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.auth-user-button:hover {
    background: #f6f8fa;
}

.user-icon {
    font-size: 18px;
}

.user-name {
    font-weight: 500;
    color: #24292f;
}

.dropdown-arrow {
    font-size: 10px;
    color: #656d76;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(140, 149, 159, 0.2);
    min-width: 180px;
    z-index: 1000;
}

.user-dropdown a {
    display: block;
    padding: 12px 16px;
    color: #24292f;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.user-dropdown a:hover {
    background: #f6f8fa;
}

.user-dropdown a:first-child {
    border-radius: 6px 6px 0 0;
}

.user-dropdown a:last-child {
    border-radius: 0 0 6px 6px;
    border-top: 1px solid #d0d7de;
}



.auth-error {
    padding: 10px 12px;
    background: #fff1f0;
    border: 1px solid #ffccc7;
    border-radius: 6px;
    color: #cf1322;
    font-size: 13px;
    margin-bottom: 12px;
}

.auth-success {
    padding: 12px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 6px;
    color: #389e0d;
    text-align: center;
    font-size: 14px;
}

.auth-success-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

/* Dashboard Layout */
.dashboard-container {
    min-height: 100vh;
    background: #f6f8fa;
    padding-top: 88px; /* Account for sticky header */
}

.dashboard-header {
    background: white;
    border-bottom: 1px solid #d0d7de;
    padding: 16px 24px;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 24px;
    color: #24292f;
}

.dashboard-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 24px;
    padding: 24px;
}

.dashboard-sidebar {
    width: 240px;
    flex-shrink: 0;
}

.dashboard-nav {
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #24292f;
    text-decoration: none;
    border-bottom: 1px solid #d0d7de;
    transition: background 0.2s;
}

.nav-item:last-child {
    border-bottom: none;
}

.nav-item:hover {
    background: #f6f8fa;
}

.nav-item.active {
    background: #ddf4ff;
    color: #0969da;
    font-weight: 500;
}

.nav-item-logout {
    color: #dc2626;
}

.nav-item-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.nav-icon {
    font-size: 18px;
}

.dashboard-main {
    flex: 1;
    min-width: 0;
}

/* Welcome Section */
.welcome-section {
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.welcome-section h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: #24292f;
}

.welcome-section p {
    margin: 0;
    color: #656d76;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 32px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #24292f;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #656d76;
}

/* Submissions Section */
.submissions-section {
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 24px;
}

.submissions-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #24292f;
}

.loading-state, .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #656d76;
}

.empty-state p {
    margin-bottom: 20px;
}

.submissions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.submission-card {
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.submission-card:hover {
    box-shadow: 0 4px 12px rgba(140, 149, 159, 0.15);
}

.submission-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.submission-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #24292f;
}

.submission-date {
    margin: 0;
    font-size: 13px;
    color: #656d76;
}

.submission-actions {
    display: flex;
    gap: 8px;
}

.btn-view {
    padding: 6px 12px;
    background: #0969da;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-view:hover {
    background: #0860ca;
}

.submission-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #d0d7de;
}

.detail-item {
    font-size: 14px;
}

.detail-label {
    font-weight: 500;
    color: #656d76;
    margin-right: 8px;
}

.detail-value {
    color: #24292f;
}

/* Profile Section */
.profile-section {
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.profile-section h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #24292f;
}

.profile-form .form-group {
    margin-bottom: 20px;
}

.profile-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #24292f;
    font-size: 14px;
}

.profile-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.profile-form input:disabled {
    background: #f6f8fa;
    color: #656d76;
    cursor: not-allowed;
}

.profile-form input:focus:not(:disabled) {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #656d76;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.status-badge.verified {
    background: #f6ffed;
    color: #389e0d;
}

.status-badge.unverified {
    background: #fff7e6;
    color: #d46b08;
}

.info-text {
    color: #24292f;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #0969da;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0860ca;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #24292f;
    border: 1px solid #d0d7de;
}

.btn-secondary:hover {
    background: #f6f8fa;
}

/* Verify Email Page */
.verify-container {
    max-width: 500px;
    margin: 20px auto; /* Reduced top margin since sticky header provides spacing */
    padding: 40px;
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 12px;
    text-align: center;
}

.verify-state h2 {
    margin: 20px 0 12px 0;
    font-size: 24px;
    color: #24292f;
}

.verify-state p {
    color: #656d76;
    margin-bottom: 24px;
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    background: #52c41a;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
}

.error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    background: #ff4d4f;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
}

/* Tab Logout Button */
.nav-tab-logout {
    color: #dc2626;
}

.nav-tab-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-content {
        flex-direction: column;
    }
    
    .dashboard-sidebar {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .submission-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .submission-details {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .sticky-header-content {
        padding: 10px 16px;
    }
    
    .auth-modal-content {
        padding: 24px;
        max-width: 100%;
    }
    
    #authModalTitle {
        font-size: 20px;
    }
    
    .auth-account-btn span {
        display: none;
    }
    
    .auth-account-btn {
        min-width: 40px;
        padding: 0;
    }
}

/* Custom dial code styling for intl-tel-input */
.custom-dial-code {
    margin-left: 8px;
    font-size: 13px;
    color: #656d76;
    font-weight: 500;
}

/* Profile sub-tabs */
.profile-sub-tab {
    background: white;
    padding: 24px;
    border-radius: 8px;
}

/* Text settings grid for profile forms */
.text-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* Update button styling */
.btn-primary {
    background: #24292f !important;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: #1c2127 !important;
}

/* Status badges for forms */
.status-badge.status-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

/* Clear filters button */
.admin-clear-filters-btn {
    height: 38px !important;
    white-space: nowrap !important;
    min-width: 120px !important;
    flex-shrink: 0 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .text-settings-grid {
        grid-template-columns: 1fr;
    }
    
    .table-controls-row {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .table-controls-row .search-box,
    .table-controls-row .filter-select,
    .table-controls-row .admin-clear-filters-btn {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Custom Modal for Password Reset and Logout */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.custom-modal .custom-modal-content {
    background-color: #ffffff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.custom-modal .custom-modal-content h3 {
    color: #24292f;
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 600;
}

.custom-modal .custom-modal-content p {
    color: #656d76;
    margin: 0 0 24px 0;
    line-height: 1.6;
    font-size: 16px;
}

.custom-modal .form-group {
    margin-bottom: 16px;
}

.custom-modal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #24292f;
    font-size: 14px;
}

.custom-modal .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.custom-modal .form-group input:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

/* Close modal on background click */
.custom-modal:not([onclick]) {
    cursor: pointer;
}

.custom-modal .custom-modal-content {
    cursor: default;
}

@media (max-width: 768px) {
    .custom-modal .custom-modal-content {
        padding: 24px;
        width: 95%;
    }
}

/* Submission Details Modal */
.detail-fields-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-field-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 12px;
    background: #f6f8fa;
    border-radius: 6px;
    border: 1px solid #d0d7de;
}

.detail-field-label {
    font-weight: 600;
    color: #24292f;
    font-size: 14px;
}

.detail-field-value {
    color: #1f2328;
    font-size: 14px;
    word-break: break-word;
}

@media (max-width: 768px) {
    .detail-field-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Centralized Form Input Styling */
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d9e0;
    border-radius: 6px;
    font-size: 14px;
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #24292f;
    box-shadow: inset 0 1px 0 rgba(208, 215, 222, 0.2), 0 0 0 2px rgba(36, 41, 47, 0.3);
}

.form-input:disabled {
    background-color: #f6f8fa;
    color: #656d76;
    cursor: not-allowed;
}
