/* ===================================
   PF Enrollment Portal - Modern Styles
   =================================== */

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    font-size: 16px;
}

/* Navbar */
.navbar {
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-content h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 1.5rem;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
}

.logo-section {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-section h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.small-text {
    font-size: 0.75rem;
}

/* Form Card */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.form-header h1 {
    font-size: 1.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.5rem;
    background-color: var(--primary-color);
    margin-right: 0.75rem;
    border-radius: 2px;
}

/* Form Rows & Groups */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.required {
    color: var(--error-color);
    margin-left: 0.25rem;
}

/* Input Styles */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background-color: var(--card-bg);
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input.error,
select.error,
textarea.error {
    border-color: var(--error-color);
}

input[type="file"] {
    padding: 0.5rem;
    font-size: 0.875rem;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.field-error {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.375rem;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin-top: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    cursor: pointer;
}

.checkbox-label.declaration {
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.declaration-box {
    margin-top: 1rem;
}

/* File Preview */
.file-preview {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.file-name {
    color: var(--text-primary);
    font-weight: 500;
}

.file-size {
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.5;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary:hover {
    background-color: #475569;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    transition: opacity 0.3s ease;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Success Page */
.success-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.success-container {
    width: 100%;
    max-width: 600px;
    padding: 1.5rem;
}

.success-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    text-align: center;
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

.success-card h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.success-message {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.success-details {
    background-color: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.success-details p {
    margin: 0.75rem 0;
    color: var(--text-primary);
}

.success-actions {
    margin-bottom: 1.5rem;
}

.success-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Error Pages */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-color);
}

.error-container {
    width: 100%;
    max-width: 500px;
    padding: 1.5rem;
}

.error-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    text-align: center;
}

.error-code {
    font-size: 6rem;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-card h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.error-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Admin Dashboard */
.dashboard-header {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.dashboard-header h1 {
    font-size: 1.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.export-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.export-buttons .btn {
    white-space: nowrap;
}

.table-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--bg-color);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.data-table tbody tr:hover {
    background-color: var(--bg-color);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-state {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state p {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Detail View */
.detail-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
}

.detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.detail-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.detail-meta {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.detail-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.detail-section h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item strong {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.detail-item span {
    color: var(--text-primary);
    font-size: 1rem;
}

.file-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .form-card,
    .detail-card {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 800px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card,
    .success-card {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .form-card,
    .detail-card {
        padding: 1rem;
    }
    
    .form-header h1 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.125rem;
    }
    
    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Countdown Timer */
.countdown-timer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    text-align: center;
}

.timer-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.timer-display {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

.timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.timer-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    min-width: 70px;
    display: block;
}

.timer-text {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.timer-message {
    font-size: 0.9375rem;
    margin-top: 1rem;
    font-weight: 500;
}

/* Draft Functionality */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.draft-info {
    background: #d1fae5;
    border: 2px solid #10b981;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
}

.draft-info code {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: var(--primary-color);
    display: inline-block;
    margin: 0.5rem 0;
    font-weight: 600;
}

.load-draft-section {
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.load-draft-section h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.draft-load-form {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.draft-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    min-width: 300px;
    font-family: 'Courier New', monospace;
}

/* Print Styles */
@media print {
    .navbar,
    .form-actions,
    .btn,
    .countdown-timer,
    .load-draft-section {
        display: none;
    }
    
    .container {
        max-width: 100%;
    }
    
    .form-card,
    .detail-card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}
