/* FINAL TEVTA BRANDED CSS - UX and Icon Fixes (Long Filename Fix) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #008000;      /* Dark Green */
    --primary-dark: #004d00;  /* Very Dark Green */
    --primary-light: #28a745; /* Success Green */
    --secondary: #6c757d;    /* Gray */
    --success: #28a745;      
    --warning: #f59e0b;
    --error: #ef4444;
    --dark: #343a40;         /* Blackish Text */
    --darker: #212529;       /* Footer/Deep Background */
    --light: #f8f8f8;        /* Light Gray Background */
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    min-height: 100vh;
}

/* CSS FIX: Hide content initially until security check passes */
body.hide-content { visibility: hidden !important; opacity: 0 !important; }
body:not(.hide-content) { visibility: visible; opacity: 1; transition: opacity 0.5s; }


.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
main { padding-top: 80px; }


/* --- NAVIGATION AND HEADER --- */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.8rem 0;
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--gray-light);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-logo img {
    height: 45px;
    margin-right: 10px;
    width: auto;
}

.nav-links { display: flex; align-items: center; gap: 1rem; }

.nav-links a {
    color: var(--dark);
    text-decoration: none; 
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
    background: rgba(0, 128, 0, 0.1);
}

/* Primary Button Class - Used for Submit, Login, Dashboard Button, Get Started */
.btn-primary, .btn-submit, .btn-login {
    background: var(--primary);
    color: white !important;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none !important; 
}

.btn-login:hover, .btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Secondary Button Class - Used for Continue Application, Save Draft */
.btn-secondary {
    background: var(--secondary); 
    color: white !important;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none !important; 
}

.btn-secondary:hover {
    background: #5a6268; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-register {
    background: var(--gradient);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: var(--shadow);
    text-decoration: none !important;
}

.btn-register:hover {
    box-shadow: var(--shadow-lg);
}

/* Enhanced Hero Section (Homepage) */
.hero {
    margin-top: 0;
    padding: 0;
    background: var(--darker); 
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Video Background Layering */
.video-background {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    z-index: 1; 
    pointer-events: none;
}

.video-background video {
    position: absolute; 
    top: 50%; 
    left: 50%; 
    min-width: 100%; 
    min-height: 100%; 
    width: auto; 
    height: auto; 
    transform: translate(-50%, -50%); 
    opacity: 0.3; 
}

/* Content Layering */
.hero-content {
    position: relative; 
    z-index: 3; 
    max-width: 800px; 
    background: rgba(0, 0, 0, 0.6); 
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: white;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Button consistency for homepage links */
.hero-buttons .btn-primary {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
}

.hero-buttons .btn-secondary {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white !important;
}

.hero-buttons .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 1.2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s;
}

.btn-submit:hover:not(.disabled) {
    background: var(--primary-dark);
}

.status-pending { background: #f59e0b; color: white; }
.status-approved { background: var(--success); color: white; }
.status-rejected { background: var(--error); color: white; }

.hero-image { display: none; }


/* Enhanced Features Section */
.features {
    padding: 6rem 0;
    background: var(--light);
}

.features h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 3rem;
    color: var(--primary-dark);
}

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-light);
}

.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.feature-card i { font-size: 3rem; margin-bottom: 1.5rem; color: var(--primary); }
.feature-card h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; color: var(--dark); }
.feature-card p { color: var(--gray); line-height: 1.6; }

/* Enhanced About Section */
.about { padding: 6rem 0; background: white; }

.about h2 { font-size: 3rem; font-weight: 800; margin-bottom: 3rem; color: var(--primary-dark); }
.about > .container > p { text-align: center; font-size: 1.2rem; max-width: 800px; margin: 0 auto 4rem; color: var(--gray); line-height: 1.8; }
.team-section h3 { font-size: 2rem; font-weight: 700; margin-bottom: 2rem; color: var(--dark); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.team-member { background: var(--light); padding: 1.5rem; border-radius: 12px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); }
.team-member h4 { color: var(--dark); margin-bottom: 0.5rem; font-weight: 600; }
.team-member p { color: var(--primary); font-weight: 500; font-size: 0.9rem; }

/* Enhanced Form Styles */
.form-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 3rem;
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border-top: 5px solid var(--primary);
}

.form-container h2 { color: var(--primary); font-weight: 700; font-size: 2.2rem; text-align: center; margin-bottom: 2rem; }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--dark); font-weight: 600; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 1rem; border: 2px solid var(--gray-light); border-radius: 12px; font-size: 1rem; transition: all 0.3s ease; background: white; }

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.1);
    transform: translateY(-2px);
}

.btn-submit:hover:not(.disabled) { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn-submit.disabled { background: var(--secondary); cursor: not-allowed; opacity: 0.7; }

.form-links { text-align: center; margin-top: 2rem; }
.form-links a { color: var(--primary); text-decoration: none; font-weight: 500; transition: color 0.3s ease; }
.form-links a:hover { color: var(--primary-dark); }


/* Enhanced Dashboard Styles */
.dashboard { margin-top: 80px; padding: 2rem 0; min-height: calc(100vh - 80px); }

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.dashboard-header h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.5rem; color: var(--primary-dark); }
.student-info { background: var(--gradient); color: white; padding: 1rem 2rem; border-radius: 16px; display: inline-block; margin-top: 1rem; box-shadow: var(--shadow); }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; margin-bottom: 3rem; }
.dashboard-card { background: white; padding: 2rem; border-radius: 16px; box-shadow: var(--shadow); border-left: 5px solid var(--primary); transition: all 0.3s ease; }
.dashboard-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.dashboard-card h3 { color: var(--dark); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; font-size: 1.3rem; font-weight: 700; }

/* Status Badges */
.status-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border-radius: 50px; font-weight: 600; margin-bottom: 1rem; }

.status-submitted { background: #dbeafe; color: #1e40af; }
.status-under-review { background: #fef3c7; color: #92400e; }
.status-accepted { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* Application Details */
.application-details { display: flex; flex-direction: column; gap: 0.75rem; }
.detail-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--gray-light); font-size: 0.9rem; }
.detail-item:last-child { border-bottom: none; }
.detail-item label { font-weight: 600; color: var(--gray); }
.detail-item span { font-weight: 500; color: var(--dark); }

/* Document and Payment Items */
.document-item, .payment-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: white; border-radius: 12px; margin-bottom: 0.75rem; border: 1px solid var(--gray-light); transition: all 0.3s ease; }
.document-item:hover, .payment-item:hover { transform: translateX(5px); box-shadow: var(--shadow); }

.doc-icon, .payment-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }

.doc-icon { background: rgba(0, 128, 0, 0.1); color: var(--primary); }
.payment-icon.completed { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.payment-icon.pending { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.doc-info { 
    flex: 1; 
    /* NEW FIX: Ensure doc-info is a flex container to manage its children */
    display: flex;
    flex-direction: column;
    min-width: 0; /* Ensures it shrinks */
}
.doc-info strong, .payment-info strong { display: block; color: var(--dark); margin-bottom: 0.25rem; }
.doc-info span { 
    /* NEW FIX: Truncate long filenames */
    display: block; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    max-width: 100%; /* Important for text-overflow to work */
    color: var(--gray); font-size: 0.9rem; 
}
.payment-info { flex: 1; }
.payment-info strong { display: block; color: var(--dark); margin-bottom: 0.25rem; }
.payment-info span { color: var(--gray); font-size: 0.9rem; }
.doc-info small, .payment-info small { color: var(--gray); font-size: 0.8rem; }

/* Empty States */
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--gray); }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }

/* Enhanced Alert System */
.custom-alert { position: fixed; top: 100px; right: 20px; z-index: 9999; min-width: 300px; background: white; border-radius: 16px; box-shadow: var(--shadow-lg); border-left: 4px solid; transform: translateX(400px); opacity: 0; transition: all 0.3s ease; }
.custom-alert.show { transform: translateX(0); opacity: 1; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #cce7ff; color: #004085; border: 1px solid #b3d7ff; }

.alert-content { padding: 1rem 1.5rem; display: flex; align-items: center; gap: 1rem; }
.alert-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: white; }

.alert-success .alert-icon { background: var(--success); }
.alert-error .alert-icon { background: var(--error); }
.alert-info .alert-icon { background: var(--primary); }

.alert-message { flex: 1; font-weight: 500; }
.alert-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--gray); padding: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }

.alert-close:hover { color: var(--dark); }

/* Loading Spinner */
.loading-spinner { width: 20px; height: 20px; border: 2px solid transparent; border-top: 2px solid white; border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; margin-right: 0.5rem; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Footer */
footer { background: var(--darker); color: white; padding: 3rem 0; margin-top: 4rem; }
.footer-content { display: flex; justify-content: space-between; align-items: flex-start; max-width: 1200px; margin: 0 auto; padding: 0 20px; flex-wrap: wrap; }
.footer-section { flex: 1; min-width: 250px; margin-bottom: 1.5rem; text-align: left; }
.footer-section h4 { color: var(--primary); margin-bottom: 1rem; }
.footer-section p, .footer-section a { color: #ccc; font-size: 0.9rem; line-height: 1.6; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.footer-section a:hover { color: white; }
.copyright { text-align: center; border-top: 1px solid #444; padding-top: 10px; margin-top: 20px; }

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links { gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
    .nav-links a { margin-left: 0; padding: 0.4rem 0.8rem; }
    .hero-content { padding: 20px; }
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }
    .footer-content { flex-direction: column; align-items: center; text-align: center; }
    .footer-section { min-width: 100%; text-align: center; }
    .footer-section p, .footer-section a { justify-content: center; }
}

/* Selection color */
::selection { background: rgba(0, 128, 0, 0.2); color: var(--dark); }