/* ========================================
   Law Enforcement Training Platform Styles
   ======================================== */

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

:root {
    --primary-color: #510400;        /* Burgundy from logo */
    --primary-dark: #6B0F2A;          /* Darker burgundy */
    --secondary-color: #0D2C54;       /* Navy blue from logo */
    --success-color: #16a34a;
    --warning-color: #ea580c;
    --danger-color: #dc2626;
    --background: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

/* ========================================
   Login Page Styles
   ======================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #510400 0%, #0D2C54 100%);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.error-message {
    margin-top: 15px;
    padding: 12px;
    background-color: #fee;
    color: var(--danger-color);
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    font-size: 0.9rem;
}

.security-notice {
    margin-top: 15px;
    opacity: 0.8;
}

/* ========================================
   Buttons
   ======================================== */

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

.btn-primary:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
}

.btn-secondary {
    padding: 10px 20px;
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background-color: var(--background);
    border-color: var(--primary-color);
}

.btn-success {
    padding: 10px 20px;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-danger {
    padding: 10px 20px;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* ========================================
   Navigation Bar
   ======================================== */

.navbar {
    background-color: var(--card-background);
    box-shadow: var(--shadow);
    padding: 16px 0;
    margin-bottom: 30px;
}

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

.nav-container h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   Container & Layout
   ======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.dashboard,
.capstone-container,
.admin-container {
    margin-top: 20px;
}

.dashboard h1,
.capstone-container h1,
.admin-container h1 {
    margin-bottom: 30px;
    color: var(--text-primary);
}

/* ========================================
   Cards
   ======================================== */

.card {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card h3 {
    margin-bottom: 16px;
    color: var(--primary-color);
}

/* ========================================
   Dashboard Specific
   ======================================== */

.group-info p,
.case-info p {
    margin-bottom: 10px;
}

.group-info ul {
    margin-left: 20px;
    margin-top: 10px;
}

.group-info li {
    margin-bottom: 5px;
}

.case-info button {
    margin-top: 20px;
}

/* ========================================
   Capstone Exercise Specific
   ======================================== */

.case-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.case-header h2 {
    color: white;
    margin-bottom: 10px;
}

.progress-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.progress-info p {
    margin-bottom: 5px;
}

.clues-section {
    background-color: #f0f9ff;
    border-left: 4px solid var(--primary-color);
}

.clue-set {
    margin-top: 15px;
}

.clue-set h4 {
    margin: 15px 0 10px;
    color: var(--primary-color);
}

.clue-set ul {
    margin-left: 20px;
}

.clue-set li {
    margin-bottom: 8px;
}

.clue-set a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.clue-set a:hover {
    text-decoration: underline;
}

.submission-section textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-top: 15px;
}

.submission-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.submission-section button {
    margin-top: 15px;
}

.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
    display: none;
}

.status-message:not(:empty) {
    display: block;
}

.status-message.success {
    background-color: #dcfce7;
    color: var(--success-color);
}

.status-message.pending {
    background-color: #fef3c7;
    color: var(--warning-color);
}

.submission-item {
    padding: 15px;
    background-color: var(--background);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid var(--border-color);
}

.submission-item.approved {
    border-left-color: var(--success-color);
}

.submission-item.pending {
    border-left-color: var(--warning-color);
}

/* ========================================
   Admin Dashboard Specific
   ======================================== */

.admin-section {
    margin-bottom: 40px;
}

.admin-section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.submission-card {
    background-color: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.submission-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.submission-card p {
    margin-bottom: 10px;
}

.submission-card em {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.submission-card strong {
    color: var(--text-primary);
}

.submission-card button {
    margin-right: 10px;
    margin-top: 15px;
}

.group-status-table {
    overflow-x: auto;
}

.group-status-table table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.group-status-table th,
.group-status-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.group-status-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.group-status-table tr:last-child td {
    border-bottom: none;
}

.group-status-table tr:hover {
    background-color: var(--background);
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========================================
   Modal
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--card-background);
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .login-form {
        padding: 30px 20px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-right {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-secondary {
        width: 100%;
    }
    
    .card {
        padding: 20px;
    }
    
    .submission-card button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-actions button {
        width: 100%;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.hidden {
    display: none !important;
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

/* ========================================
   Manual Control Section
   ======================================== */

.manual-control-group {
    padding: 20px;
    margin: 15px 0;
    background: var(--background);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
}

.manual-control-group h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.manual-control-group p {
    margin: 5px 0;
}

.manual-control-group button {
    margin-right: 10px;
    margin-top: 15px;
}

/* ========================================
   Previous Clues Accordion
   ======================================== */

.previous-clue-item {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.previous-clue-header {
    cursor: pointer;
    padding: 10px;
    background: #ffffff;
    border-radius: 6px;
    transition: background 0.2s;
}

.previous-clue-header:hover {
    background: #f8f9fa;
}

.previous-clue-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--primary-color);
}

.previous-clue-content {
    padding: 15px;
    background: #ffffff;
    border-left: 3px solid var(--primary-color);
    margin-left: 10px;
}

.previous-clue-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.previous-clue-content a:hover {
    text-decoration: underline;
}

/* ========================================
   Loading Spinner
   ======================================== */

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Checkbox Submission Section
   ======================================== */

#checkboxSection {
    margin: 20px 0;
}

.checkbox-option {
    margin: 12px 0;
    padding: 10px;
    border-left: 3px solid var(--border-color);
    transition: border-color 0.2s;
}

.checkbox-option:hover {
    border-left-color: var(--primary-color);
}

.checkbox-option label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 1rem;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.other-option {
    margin-top: 20px;
    padding: 15px;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.other-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.other-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.other-option textarea {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
}

/* ========================================
   File Upload Section
   ======================================== */

.file-upload-section {
    margin-top: 20px;
    padding: 20px;
    background: var(--background);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
}

.file-upload-section h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.file-upload-section input[type="file"] {
    display: block;
    padding: 10px;
    margin: 15px 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 100%;
    max-width: 500px;
}

.uploaded-files-list {
    margin-top: 10px;
    color: var(--text-secondary);
}

.uploaded-files-list ul {
    margin: 5px 0;
}

.uploaded-files-list li {
    padding: 5px 0;
}

/* ========================================
   Resources Banner
   ======================================== */

.resources-banner-top {
    background: linear-gradient(135deg, #510400 0%, #0D2C54 100%);
    color: white;
    padding: 12px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.resources-inline {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.95rem;
}

.resources-inline strong {
    font-weight: 600;
}

.resources-inline a {
    color: white;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.resources-inline a:hover {
    opacity: 0.8;
}

.resources-inline span {
    color: rgba(255,255,255,0.6);
}

.resources-links {
    margin-top: 10px;
}

.resources-links p {
    margin: 8px 0;
}

.resources-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.resources-links a:hover {
    text-decoration: underline;
}

/* ========================================
   Modules Specific
   ======================================== */

.modules-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.module-card {
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.module-card h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.module-card p {
    flex-grow: 1;
    margin: 15px 0;
    line-height: 1.6;
}

.module-card .btn-primary {
    margin-top: auto;
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    padding: 12px 24px;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.module-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.module-meta {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.module-modal-content {
    max-width: 900px;
}

.module-intro {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    padding: 20px;
    background: var(--background);
    border-left: 4px solid var(--primary-color);
}

.module-section {
    margin: 30px 0;
    padding: 25px;
    background: var(--background);
    border-radius: 8px;
}

.module-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.section-content {
    line-height: 1.8;
    margin: 15px 0;
}

.quiz-section {
    margin-top: 25px;
    padding: 20px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
}

.quiz-question {
    margin: 15px 0;
    padding: 15px;
    background: var(--background);
    border-radius: 6px;
}

.quiz-answer {
    color: var(--success-color);
    font-weight: 500;
    margin-top: 10px;
}

.module-completion {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
    display: flex;
    gap: 15px;
    justify-content: center;
}

.file-previews {
    margin: 15px 0;
}

.file-item {
    margin: 10px 0;
    padding: 10px;
    background: var(--background);
    border-radius: 6px;
}

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

.file-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.text-clues {
    margin-left: 20px;
}

.text-clues li {
    margin-bottom: 10px;
    padding: 10px;
    background: var(--background);
    border-radius: 6px;
}

/* ========================================
   Survey Specific
   ======================================== */

.survey-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

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

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 25px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: var(--background);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 48px;
}

.radio-group label:hover {
    background-color: #e0e7ff;
}

.radio-group input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.survey-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-top: 8px;
}

.survey-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.resources-info {
    padding: 15px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 10px;
}

.resources-info p {
    margin-bottom: 0;
}

/* ========================================
   Responsive Updates
   ======================================== */

@media (max-width: 768px) {
    .modules-list {
        grid-template-columns: 1fr;
    }
    
    .module-completion {
        flex-direction: column;
    }
    
    .module-completion button {
        width: 100%;
    }
}
