/* KSP Final Year Repository - Custom Styles */

/* Brand Colors */
:root {
    --ksp-primary: #2E7D32;
    --ksp-secondary: #1565C0;
    --ksp-accent: #FF6F00;
    --ksp-success: #388E3C;
    --ksp-warning: #F57C00;
    --ksp-danger: #D32F2F;
    --ksp-info: #0288D1;
    --ksp-light: #F5F5F5;
    --ksp-dark: #212121;
}

/* Logo and Branding */
.navbar-brand-box .logo img {
    max-height: 50px;
    width: auto;
    object-fit: contain;
    object-position: center;
}

.navbar-brand-box .logo-sm img {
    max-height: 40px;
    max-width: 40px;
    object-fit: contain;
}

.navbar-brand-box .logo-lg img {
    max-height: 35px;
    max-width: 180px;
    object-fit: contain;
}

.auth-logo img {
    max-height: 50px;
    max-width: 50px;
    object-fit: contain;
    object-position: center;
}

/* About page logo */
.about-logo {
    max-height: 100px;
    max-width: 300px;
    object-fit: contain;
    object-position: center;
}

/* Logo container adjustments */
.navbar-brand-box {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-sm, .logo-lg {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Auth page logo container */
.auth-logo .avatar-title {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

/* Ensure logos maintain aspect ratio */
img[src*="logo-poly"] {
    object-fit: contain;
    object-position: center;
}

/* Responsive logo adjustments */
@media (max-width: 768px) {
    .navbar-brand-box .logo-lg img {
        max-height: 30px;
        max-width: 140px;
    }
    
    .navbar-brand-box .logo-sm img {
        max-height: 35px;
        max-width: 35px;
    }
    
    .about-logo {
        max-height: 80px;
        max-width: 240px;
    }
    
    .auth-logo img {
        max-height: 45px;
        max-width: 45px;
    }
}

@media (max-width: 480px) {
    .navbar-brand-box .logo-lg img {
        max-height: 25px;
        max-width: 120px;
    }
    
    .navbar-brand-box .logo-sm img {
        max-height: 30px;
        max-width: 30px;
    }
    
    .about-logo {
        max-height: 70px;
        max-width: 200px;
    }
    
    .auth-logo img {
        max-height: 40px;
        max-width: 40px;
    }
}

/* Custom Button Styles */
.btn-ksp-primary {
    background-color: var(--ksp-primary);
    border-color: var(--ksp-primary);
    color: white;
}

.btn-ksp-primary:hover {
    background-color: #1B5E20;
    border-color: #1B5E20;
    color: white;
}

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

.btn-ksp-secondary:hover {
    background-color: #0D47A1;
    border-color: #0D47A1;
    color: white;
}

/* Project Cards */
.project-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.project-card .card-body {
    padding: 1.5rem;
}

.project-title {
    color: var(--ksp-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.project-meta {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.project-abstract {
    color: #495057;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Status Badges */
.status-pending {
    background-color: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEAA7;
}

.status-approved {
    background-color: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.status-rejected {
    background-color: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

/* File Upload Area */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: border-color 0.2s ease-in-out;
}

.upload-area:hover {
    border-color: var(--ksp-primary);
    background-color: #f0f8f0;
}

.upload-area.dragover {
    border-color: var(--ksp-primary);
    background-color: #e8f5e8;
}

.upload-icon {
    font-size: 3rem;
    color: var(--ksp-primary);
    margin-bottom: 1rem;
}

/* Search and Filter Section */
.search-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.search-section .form-control,
.search-section .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
}

.search-section .form-control:focus,
.search-section .form-select:focus {
    border-color: var(--ksp-primary);
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25);
}

/* Statistics Cards */
.stats-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--ksp-primary);
    transition: transform 0.2s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-2px);
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ksp-primary);
    margin-bottom: 0.5rem;
}

.stats-label {
    color: #6c757d;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Navigation Enhancements */
.vertical-menu .metismenu li a {
    color: #74788d;
    display: block;
    padding: 12px 20px;
    border-radius: 6px;
    margin: 2px 0;
    transition: all 0.2s ease-in-out;
}

.vertical-menu .metismenu li a:hover {
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--ksp-primary);
}

.vertical-menu .metismenu li.mm-active > a {
    background-color: var(--ksp-primary);
    color: white;
}

/* Table Enhancements */
.table-custom {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-custom thead th {
    background-color: var(--ksp-primary);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table-custom tbody tr {
    transition: background-color 0.2s ease-in-out;
}

.table-custom tbody tr:hover {
    background-color: rgba(46, 125, 50, 0.05);
}

/* Form Enhancements */
.form-floating > label {
    color: #6c757d;
}

.form-control:focus {
    border-color: var(--ksp-primary);
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25);
}

.form-select:focus {
    border-color: var(--ksp-primary);
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25);
}

/* Alert Enhancements */
.alert-ksp {
    background-color: #e8f5e8;
    border-color: var(--ksp-primary);
    color: #1B5E20;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(46, 125, 50, 0.3);
    border-radius: 50%;
    border-top-color: var(--ksp-primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Enhancements */
@media (max-width: 768px) {
    .project-card {
        margin-bottom: 1rem;
    }
    
    .search-section {
        padding: 1rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        border-radius: 8px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .project-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .search-section {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: white;
    }
    
    .project-card {
        background-color: #2d3748;
        border-color: #4a5568;
        color: white;
    }
    
    .stats-card {
        background-color: #2d3748;
        color: white;
    }
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--ksp-primary);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .project-card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid #000;
    }
}

/* Animation for page transitions */
.page-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--ksp-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1B5E20;
}