/* Modern CSS Variables */
:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --warning: #f72585;
    --danger: #e63946;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --border: #dee2e6;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --sidebar-width: 280px;
    --header-height: 70px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    box-shadow: var(--card-shadow);
    padding: 25px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 0 25px 25px;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 25px;
}

.logo h1 {
    color: var(--primary);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo p {
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 5px;
}

.nav-menu {
    list-style: none;
    padding: 0 15px;
    flex: 1;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--dark);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.data-management {
    padding: 20px 15px 0;
    border-top: 1px solid var(--light-gray);
    margin-top: 20px;
}

.btn-block {
    width: 100%;
    margin-bottom: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title h2 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.page-title p {
    color: var(--gray);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.stat-card.large {
    flex-direction: column;
    text-align: center;
    gap: 15px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.applications {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.stat-icon.exams {
    background: rgba(244, 114, 182, 0.1);
    color: var(--warning);
}

.stat-icon.completed {
    background: rgba(76, 201, 240, 0.1);
    color: var(--success);
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

.stat-chart {
    width: 100%;
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
}

.chart-bar {
    background: var(--primary);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Content Sections */
.content-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 1100px) {
    .content-sections {
        grid-template-columns: 1fr;
    }
}

.section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--card-shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.3rem;
    color: var(--dark);
}

.section-actions {
    display: flex;
    gap: 10px;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 10px;
}

/* Button Styles */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--gray);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Applications List */
.applications-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.application-card {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.application-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.application-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
}

.application-org {
    color: var(--gray);
    font-size: 0.9rem;
}

.application-fee {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.application-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.date-item {
    display: flex;
    flex-direction: column;
}

.date-label {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 3px;
}

.date-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.application-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-applied { background: #e3f2fd; color: #1976d2; }
.status-admitCardDownloaded { background: #fff3e0; color: #f57c00; }
.status-examGiven { background: #e8f5e8; color: #388e3c; }
.status-resultDeclared { background: #fce4ec; color: #c2185b; }
.status-selected { background: #e8f5e8; color: #2e7d32; }
.status-rejected { background: #ffebee; color: #c62828; }

.application-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: var(--gray);
}

.action-btn:hover {
    background: var(--light-gray);
    color: var(--dark);
}

/* Upcoming Exams */
.upcoming-exams {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.upcoming-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}

.upcoming-card:hover {
    transform: translateY(-5px);
}

.upcoming-card.urgent {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.upcoming-card.warning {
    background: linear-gradient(135deg, #ffa726, #f57c00);
}

.upcoming-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.upcoming-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.upcoming-org {
    opacity: 0.9;
    font-size: 0.9rem;
}

.days-left {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.upcoming-dates {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Filter & Search */
.filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

#searchInput {
    min-width: 200px;
}

/* Notification Bell */
.notification-bell {
    position: relative;
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    color: var(--gray);
}

.notification-bell:hover {
    color: var(--primary);
    transform: scale(1.05);
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--warning);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Notification Panel */
.notification-panel {
    position: fixed;
    top: 100px;
    right: 30px;
    width: 400px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--hover-shadow);
    z-index: 1000;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.notification-panel.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.notification-header h3 {
    margin: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

#closeNotifications {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.notification-item {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    background: var(--light);
    border-left: 4px solid var(--primary);
}

.notification-item.urgent {
    border-left-color: var(--warning);
}

.notification-item.warning {
    border-left-color: var(--success);
}

.notification-message {
    font-weight: 500;
    margin-bottom: 5px;
}

.notification-time {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 10px;
}

/* Status Breakdown */
.status-breakdown {
    margin-top: 30px;
}

.status-breakdown h4 {
    margin-bottom: 15px;
    color: var(--dark);
}

.status-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--light);
    border-radius: 10px;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-count {
    font-weight: 600;
    font-size: 1.2rem;
}

/* 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);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray);
}

.close:hover {
    color: var(--dark);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        overflow: visible;
    }
    
    .logo h1 span, .logo p, .nav-link span, .btn-block span {
        display: none;
    }
    
    .logo h1, .btn-block {
        justify-content: center;
    }
    
    .main-content {
        margin-left: 70px;
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .application-header, .application-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .application-actions {
        align-self: flex-end;
    }
    
    .notification-panel {
        width: 90%;
        right: 5%;
        left: 5%;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark);
}