/**
 * Professional User Dashboard Styles
 * Custom Survey Manager - User Portal
 * Color Scheme: #127801 (Government Green)
 */

/* Import pagination styles from admin CSS (or define here) */

/* ========================================
   GLOBAL RESET & BASE STYLES
   ======================================== */

* {
    box-sizing: border-box;
}

.cs-user-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    background: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
}

/* ========================================
   USER SIDEBAR NAVIGATION
   ======================================== */

.cs-user-sidebar {
    width: 18%;
    min-width: 220px;
    max-width: 280px;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    flex-shrink: 0;
}

.cs-user-sidebar-header {
    padding: 24px 20px;
    border-bottom: 2px solid #127801;
    background: #127801;
    flex-shrink: 0;
}

.cs-user-sidebar-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.cs-user-sidebar-nav {
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.cs-user-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.cs-user-nav-item:hover {
    background: #f8f8f8;
    color: #127801;
}

.cs-user-nav-item.active {
    background: #f0f7ef;
    color: #127801;
    border-left-color: #127801;
    font-weight: 600;
}

.cs-user-nav-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.cs-user-nav-text {
    font-size: 14px;
}

.cs-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 20000;
    pointer-events: none;
}

.cs-notification {
    min-width: 260px;
    max-width: 360px;
    background: #ffffff;
    color: #1b1b1b;
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #127801;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    pointer-events: auto;
    display: none;
}

.cs-notification-success {
    border-left-color: #127801;
}

.cs-notification-error {
    border-left-color: #b3261e;
    color: #b3261e;
}

.cs-notification-text {
    display: block;
}

.cs-user-sidebar-footer {
    padding: 16px 20px 24px;
    border-top: 1px solid #e6e6e6;
    flex-shrink: 0;
}

.cs-user-logout {
    display: block;
    text-align: center;
    background: #127801;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}

.cs-user-logout:hover {
    background: #0d5e01;
    color: #ffffff;
}

/* ========================================
   USER MAIN CONTENT AREA
   ======================================== */

.cs-user-main-content {
    flex: 1;
    width: 82%;
    padding: 32px 40px;
    background: #f5f5f5;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
}

.cs-user-page-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.cs-user-page-header h1 {
    margin: 0 0 8px 0;
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.cs-user-page-description {
    margin: 0;
    color: #666666;
    font-size: 14px;
}

.cs-user-page-content {
    background: #ffffff;
    padding: 32px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ========================================
   USER STATISTICS CARDS
   ======================================== */

.cs-user-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.cs-user-stat-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    border-left: 4px solid #127801;
}

.cs-user-stat-icon {
    font-size: 36px;
    margin-right: 20px;
}

.cs-user-stat-content {
    flex: 1;
}

.cs-user-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #127801;
    line-height: 1;
    margin-bottom: 4px;
}

.cs-user-stat-label {
    font-size: 14px;
    color: #666666;
    font-weight: 500;
}

/* ========================================
   USER DASHBOARD SECTIONS
   ======================================== */

.cs-user-dashboard-section {
    background: #ffffff;
    padding: 32px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.cs-user-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.cs-user-section-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

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

.cs-user-submission-card {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.cs-user-submission-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #127801;
}

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

.cs-user-submission-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
}

.cs-user-submission-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666666;
}

/* ========================================
   USER SURVEY CARDS
   ======================================== */

.cs-user-surveys-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cs-user-survey-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 24px;
    transition: all 0.2s ease;
}

.cs-user-survey-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #127801;
}

.cs-user-survey-header {
    margin-bottom: 16px;
}

.cs-user-survey-title-section h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.cs-user-survey-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #666666;
}

.cs-user-survey-description {
    margin-bottom: 16px;
    color: #666666;
    font-size: 14px;
    line-height: 1.6;
}

.cs-user-survey-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ========================================
   USER BUTTONS
   ======================================== */

.cs-user-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.5;
}

.cs-user-btn-primary {
    background: #127801;
    color: #ffffff;
}

.cs-user-btn-primary:hover {
    background: #0f6601;
    color: #ffffff;
}

.cs-user-btn-secondary {
    background: #e0e0e0;
    color: #333333;
}

.cs-user-btn-secondary:hover {
    background: #d0d0d0;
}

.cs-user-btn-link {
    color: #127801;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.cs-user-btn-link:hover {
    text-decoration: underline;
}

/* ========================================
   USER BADGES
   ======================================== */

.cs-user-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cs-user-badge-submitted {
    background: #d4edda;
    color: #155724;
}

.cs-user-badge-pending {
    background: #fff3cd;
    color: #856404;
}

/* ========================================
   USER PROFILE
   ======================================== */

.cs-user-profile-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 32px;
}

.cs-user-profile-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.cs-user-profile-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.cs-user-profile-section h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.cs-user-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.cs-user-profile-field {
    display: flex;
    flex-direction: column;
}

.cs-user-profile-field-full {
    grid-column: 1 / -1;
}

.cs-user-profile-field label {
    font-size: 13px;
    font-weight: 600;
    color: #666666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cs-user-profile-value {
    font-size: 15px;
    color: #1a1a1a;
    padding: 8px 0;
}

/* ========================================
   USER SURVEY FORM (Existing)
   ======================================== */

.cs-user-survey-form {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cs-user-survey-form h2 {
    margin: 0 0 16px 0;
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 600;
}

.cs-survey-description {
    margin-bottom: 24px;
    color: #666666;
    font-size: 14px;
    line-height: 1.6;
}

.cs-survey-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.cs-survey-section:last-child {
    border-bottom: none;
}

.cs-section-title {
    margin: 0 0 12px 0;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
}

.cs-section-description {
    margin: 0 0 20px 0;
    color: #666666;
    font-size: 14px;
}

.cs-question-field {
    margin-bottom: 20px;
}

.cs-question-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333333;
    font-size: 14px;
}

.cs-question-field .required {
    color: #dc3545;
}

.cs-question-field input[type="text"],
.cs-question-field input[type="number"],
.cs-question-field textarea,
.cs-question-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.cs-question-field input:focus,
.cs-question-field textarea:focus,
.cs-question-field select:focus {
    outline: none;
    border-color: #127801;
    box-shadow: 0 0 0 3px rgba(18, 120, 1, 0.1);
}

.cs-radio-group,
.cs-checkbox-group,
.cs-mcq-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-radio-label,
.cs-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.cs-radio-label:hover,
.cs-checkbox-label:hover {
    background: #f8f8f8;
}

.cs-radio-label input,
.cs-checkbox-label input {
    margin-right: 8px;
    width: auto;
}

.cs-user-survey-form .submit {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.cs-user-survey-form .button-primary {
    background: #127801;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cs-user-survey-form .button-primary:hover {
    background: #0f6601;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.cs-user-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #666666;
}

.cs-user-empty-state p {
    margin: 0;
    font-size: 14px;
}

.cs-user-error {
    background: #fff5f5;
    border: 1px solid #fc8181;
    border-left: 4px solid #e53e3e;
    color: #742a2a;
    padding: 16px 20px;
    border-radius: 4px;
    margin: 24px;
    font-size: 14px;
}

.cs-no-survey {
    background: #fff5f5;
    border: 1px solid #fc8181;
    border-left: 4px solid #e53e3e;
    color: #742a2a;
    padding: 16px 20px;
    border-radius: 4px;
    margin: 24px 0;
    font-size: 14px;
}

.cs-alert {
    padding: 16px 20px;
    border-radius: 4px;
    margin-bottom: 24px;
    font-size: 14px;
}

.cs-alert-error {
    background: #fff5f5;
    border: 1px solid #fc8181;
    border-left: 4px solid #e53e3e;
    color: #742a2a;
}

.cs-alert-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-left: 4px solid #2271b1;
    color: #0a4b78;
}

/* ========================================
   SUB-QUESTIONS (CONDITIONAL)
   ======================================== */

.cs-sub-question {
    margin-left: 24px;
    padding-left: 20px;
    border-left: 2px solid #127801;
}

/* ========================================
   PAGINATION
   ======================================== */

.cs-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 16px 0;
    border-top: 1px solid #e0e0e0;
}

.cs-pagination-info {
    color: #666;
    font-size: 14px;
}

.cs-pagination-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.cs-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.cs-pagination-link:hover:not(.cs-pagination-disabled):not(.cs-pagination-current) {
    background: #127801;
    color: #ffffff;
    border-color: #127801;
}

.cs-pagination-link.cs-pagination-current {
    background: #127801;
    color: #ffffff;
    border-color: #127801;
    cursor: default;
}

.cs-pagination-link.cs-pagination-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
}

.cs-pagination-dots {
    padding: 0 8px;
    color: #999;
    font-size: 14px;
}

.cs-pagination-first,
.cs-pagination-prev,
.cs-pagination-next,
.cs-pagination-last {
    font-weight: 600;
}

@media (max-width: 768px) {
    .cs-pagination {
        flex-direction: column;
        gap: 16px;
    }

    .cs-pagination-info {
        text-align: center;
    }

    .cs-pagination-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .cs-user-sidebar {
        width: 20%;
        min-width: 200px;
    }
    
    .cs-user-main-content {
        width: 80%;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .cs-user-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .cs-user-sidebar {
        width: 100%;
        height: auto;
        max-height: 60vh;
        min-width: 100%;
        max-width: 100%;
    }
    
    .cs-user-main-content {
        width: 100%;
        height: auto;
        min-height: 40vh;
        padding: 20px;
    }
    
    .cs-user-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .cs-user-profile-grid {
        grid-template-columns: 1fr;
    }
}
