/* Control Room DSR Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* General Styles */
html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* Hero Section */
.hero-section {
    background: #f0f4f8;
    color: #2c3e50;
    min-height: 100vh;
    padding-top: 2rem;
}

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

.login-btn {
    padding: 1rem;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none;
}

/* Main Hero Image */
.main-image-container {
    position: relative;
    max-width: 350px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: visible;
    animation: float 6s ease-in-out infinite;
}

.main-hero-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.main-hero-image:hover {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(13, 110, 253, 0.8), rgba(118, 75, 162, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.main-image-container:hover .image-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.main-image-container:hover .overlay-content {
    transform: translateY(0);
}

/* Officer Details Styling */
.officer-details {
    background: transparent;
    padding: 1rem 0;
}

.officer-name {
    color: #000;
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.officer-designation,
.officer-state {
    color: #000;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

/* Fallback when no image */
.main-image-container:empty::before {
    content: "";
    display: block;
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
}

.main-image-container:empty::after {
    content: "📊 Control Room DSR System";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
}

/* Feature Cards */
.feature-card {
    background: #6ff5e7;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Login Card */
.login-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Dashboard Cards */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color), #4a90e2);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

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

.stat-card.bg-primary {
    background: linear-gradient(135deg, #0d6efd, #4a90e2);
}

.stat-card.bg-success {
    background: linear-gradient(135deg, #198754, #28a745);
}

.stat-card.bg-warning {
    background: linear-gradient(135deg, #ffc107, #ffdb4d);
}

.stat-card.bg-info {
    background: linear-gradient(135deg, #0dcaf0, #17a2b8);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-content h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: bold;
}

.stat-content p {
    margin: 0;
    opacity: 0.9;
}

/* District Cards */
.district-card {
    display: block;
    background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
    padding: 2rem 1rem;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    border: none;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.district-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    text-decoration: none;
    color: white;
    opacity: 1;
}

.district-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.3px;
    line-height: 1.4;
    padding: 1rem 0;
}

/* District Card Color Variants - Professional Dark */
.district-card-blue {
    background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
    color: white;
}

.district-card-green {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
    color: white;
}

.district-card-orange {
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    color: white;
}

.district-card-purple {
    background: linear-gradient(135deg, #ab47bc 0%, #8e24aa 100%);
    color: white;
}

.district-card-red {
    background: linear-gradient(135deg, #ef5350 0%, #e53935 100%);
    color: white;
}

.district-card-teal {
    background: linear-gradient(135deg, #26a69a 0%, #00897b 100%);
    color: white;
}

.district-card-pink {
    background: linear-gradient(135deg, #ec407a 0%, #d81b60 100%);
    color: white;
}

.district-card-indigo {
    background: linear-gradient(135deg, #5c6bc0 0%, #3949ab 100%);
    color: white;
}

/* Form Cards */
.form-card {
    display: block;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.2s;
    border: 2px solid transparent;
    height: 100%;
}

.form-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--success-color);
    text-decoration: none;
    color: var(--success-color);
}

.form-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--success-color);
}

.form-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.form-fields {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

/* Forms List */
.forms-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 5px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.form-item:hover {
    background: var(--light-color);
    transform: translateX(5px);
    text-decoration: none;
    color: var(--primary-color);
}

.form-item .form-icon {
    font-size: 1.2rem;
    margin: 0;
    color: var(--primary-color);
}

.form-item .form-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Search Container */
.search-container .input-group {
    max-width: 500px;
}

/* Tables */
.table {
    background: white;
}

.table th {
    background: var(--light-color);
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

/* Custom Header Styles */
.header-title {
    font-size: 2.2rem !important;
    font-weight: 700 !important;
    color: white !important;
    text-decoration: none !important;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header-title:hover {
    color: #f8f9fa !important;
    text-decoration: none !important;
}

.header-logo {
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.header-logo:hover {
    transform: scale(1.05);
}

.navbar-left, .navbar-right {
    min-height: 85px;
    display: flex;
    align-items: center;
}

/* Equal spacing from center title */
.navbar-left {
    padding-right: 1rem;
}

.navbar-right {
    padding-left: 1rem;
}

/* Increase navbar padding */
.navbar {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

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

/* Responsive Header */
@media (max-width: 768px) {
    .navbar-left, .navbar-right {
        width: auto !important;
        min-width: 80px;
        min-height: 60px;
        padding: 0.25rem !important;
        flex: 0 0 auto !important;
    }
    
    .navbar-left {
        padding-right: 0.5rem !important;
    }
    
    .navbar-right {
        padding-left: 0.5rem !important;
    }
    
    .header-title {
        font-size: 1.4rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }
    
    .header-logo {
        max-height: 45px !important;
        max-width: 100px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
    }
}

/* iPad Air Specific Fix (820x1180) */
@media (min-width: 769px) and (max-width: 834px) and (min-height: 1000px) {
    .navbar-left, .navbar-right {
        width: auto !important;
        min-width: 100px;
        padding: 0.5rem !important;
        flex: 0 0 auto !important;
    }
    
    .navbar-right .d-flex {
        gap: 1rem !important;
        justify-content: flex-end !important;
        align-items: center !important;
    }
    
    .header-logo {
        max-height: 50px !important;
        max-width: 120px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
        flex-shrink: 0 !important;
    }
    
    .header-title {
        font-size: 1.6rem !important;
    }
    .navbar {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

/* Extra Mobile Responsiveness for Logo Display */
@media (max-width: 576px) {
    .navbar-left, .navbar-right {
        width: auto !important;
        min-width: 50px;
        min-height: 50px;
        padding: 0.2rem !important;
        flex: 0 0 auto !important;
    }
    
    .navbar-left {
        padding-right: 0.25rem !important;
    }
    
    .navbar-right {
        padding-left: 0.25rem !important;
    }
    
    .navbar-right .d-flex {
        gap: 0.5rem !important;
        justify-content: flex-end !important;
    }
    
    .header-title {
        font-size: 1.1rem !important;
        padding: 0 0.3rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .header-logo {
        max-height: 35px !important;
        max-width: 70px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
        flex-shrink: 0 !important;
    }
    
    .navbar {
        padding-top: 0.4rem !important;
        padding-bottom: 0.4rem !important;
    }
    
    .navbar-center {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
    
    /* Ensure user dropdown is visible */
    .dropdown-menu {
        min-width: 150px !important;
        right: 0 !important;
        left: auto !important;
    }
}

/* Ultra Small Mobile Devices - Prevent Logo Overlap */
@media (max-width: 400px) {
    .navbar-left, .navbar-right {
        width: auto !important;
        min-width: 35px;
        padding: 0.1rem !important;
        flex: 0 0 auto !important;
    }
    
    .navbar-right .d-flex {
        gap: 0.3rem !important;
        justify-content: flex-end !important;
        align-items: center !important;
    }
    
    .header-title {
        font-size: 0.9rem !important;
        padding: 0 0.2rem !important;
        letter-spacing: 0 !important;
    }
    
    .header-logo {
        max-height: 28px !important;
        max-width: 50px !important;
        flex-shrink: 0 !important;
        display: block !important;
    }
    
    .navbar {
        padding-top: 0.3rem !important;
        padding-bottom: 0.3rem !important;
    }
}

/* Upload Type Colors */
.badge-purple {
    background-color: #8e44ad !important;
    color: white !important;
}

.border-purple {
    border: 2px solid #8e44ad !important;
}

.border-danger {
    border: 2px solid #dc3545 !important;
}

/* Grouped File Items */
.file-row {
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.file-row:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateX(2px);
}

.align-top {
    vertical-align: top !important;
}

/* Upload Area Styling */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.upload-area:hover {
    border-color: #0d6efd;
    background-color: #f8f9fa;
}

/* Footer */
footer {
    background: var(--dark-color) !important;
    flex-shrink: 0;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }
    
    .search-container .input-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-container .input-group > * {
        border-radius: 5px !important;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .form-card, .district-card {
        margin-bottom: 1rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Form Styles */
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
}

/* Modal Styles */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* Control Room Dashboard */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
}

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

.upload-area.dragover {
    border-color: var(--success-color);
    background: #f0fff4;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Admin Dashboard Grouped Entries */
.form-table {
    font-size: 0.9rem;
}

.form-table th {
    background-color: var(--light-color);
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid var(--primary-color);
    padding: 12px 8px;
    white-space: nowrap;
    text-align: center;
}

.form-table td {
    padding: 10px 8px;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

.form-table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.form-table .badge {
    font-size: 0.75em;
}

/* Responsive table adjustments */
@media (max-width: 768px) {
    .form-table {
        font-size: 0.8rem;
    }
    
    .form-table th,
    .form-table td {
        padding: 8px 4px;
    }
}

/* Entry count badge */
.card-header .badge {
    font-size: 0.75em;
    vertical-align: middle;
}

/* Print Styles */
@media print {
    .navbar, .btn, .card-header { display: none !important; }
    .card { box-shadow: none; border: 1px solid #000; }
    .form-table { font-size: 0.8rem; }
}
