/* ==========================================
   Global Warming Awareness Site - Custom CSS
   ========================================== */

:root {
    --primary-green: #2ecc71;
    --dark-green: #27ae60;
    --ocean-blue: #3498db;
    --sky-blue: #87ceeb;
    --warm-orange: #e67e22;
    --alert-red: #e74c3c;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--dark-green) 0%, var(--ocean-blue) 100%);
    padding: 40px 0 50px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.5;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Stat Cards */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

/* Project Cards */
.project-card {
    transition: all 0.3s ease;
    border: none;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15) !important;
}

.project-card .card-img-top {
    transition: transform 0.3s ease;
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.project-card:hover .card-img-top {
    transform: scale(1.05);
}

.project-card .card-body {
    position: relative;
    z-index: 1;
}

/* Podcast Embed */
.podcast-embed {
    background: linear-gradient(135deg, #1db954 0%, #191414 100%);
    border-radius: 8px;
    overflow: hidden;
}

.podcast-embed iframe {
    border-radius: 8px;
}

/* Login Card */
.card {
    border: none;
    border-radius: 15px;
}

.login-card .card-body {
    padding: 3rem;
}

/* Dashboard Styles */
.list-group-item {
    border-left: none;
    border-right: none;
    transition: background-color 0.2s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

.list-group-item:first-child {
    border-top: none;
}

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

.btn-success {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-success:hover {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    transition: color 0.2s ease;
}

/* Footer - ensure visible on dark background, stick to bottom */
footer {
    margin-top: auto;
}

footer .text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 50px 0 70px;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .project-card .card-img-top {
        aspect-ratio: 16 / 9;
    }
}

/* Custom scrollbar for project list */
.list-group-flush {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-green) #f1f1f1;
}

.list-group-flash::-webkit-scrollbar {
    width: 6px;
}

.list-group-flush::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.list-group-flush::-webkit-scrollbar-thumb {
    background-color: var(--primary-green);
    border-radius: 10px;
}

/* Modal enhancements */
.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    border-radius: 15px 15px 0 0;
}

/* Buttons with icons */
.btn {
    border-radius: 8px;
    font-weight: 500;
}

/* Minimum height helper */
.min-vh-75 {
    min-height: auto;
}

.min-vh-80 {
    min-height: auto;
}

/* Take Action & Footer spacing */
.section-compact {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
}

/* Dashboard full-width layout */
.dashboard-fullscreen {
    min-height: calc(100vh - 200px);
}

.dashboard-fullscreen .container-fluid {
    max-width: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Dashboard redesign */
.dashboard-header {
    background: linear-gradient(135deg, #1a5f2a 0%, #27ae60 50%, #2ecc71 100%);
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 4px 20px rgba(39, 174, 96, 0.3);
}

.dashboard-card {
    border-radius: 1rem;
    overflow: hidden;
}

.dashboard-card-header {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border: none;
}

.dashboard-welcome {
    background: linear-gradient(135deg, #f8fdf9 0%, #e8f5e9 100%);
}

.dashboard-welcome-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: white;
    opacity: 0.9;
}

.dashboard-modal-header {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
}

/* New Project modal: scrollable on mobile and desktop */
#newProjectModal .modal-dialog {
    display: flex;
    flex-direction: column;
}
#newProjectModal .modal-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#newProjectModal .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
/* Mobile: fullscreen modal with body scroll */
@media (max-width: 575.98px) {
    #newProjectModal .modal-content {
        max-height: 100vh;
        height: 100vh;
    }
    #newProjectModal .modal-body {
        flex: 1 1 auto;
        min-height: 0;
    }
}
/* Desktop: limit height and enable body scroll */
@media (min-width: 576px) {
    #newProjectModal .modal-dialog {
        max-height: calc(100vh - 2rem);
        align-items: center;
    }
    #newProjectModal .modal-content {
        max-height: calc(100vh - 2rem);
    }
    #newProjectModal .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: calc(100vh - 8rem);
    }
}

.project-list-scroll {
    max-height: 420px;
    overflow-y: auto;
}

.project-list-item {
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.project-list-item:hover {
    background: #f8fdf9;
}

.project-list-item.active {
    background: rgba(46, 204, 113, 0.15);
}

.project-thumb {
    width: 48px;
    height: 48px;
}

.project-thumb img,
.project-thumb .no-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-thumb .no-thumb {
    background: #f0f0f0;
}

.dashboard-empty-icon {
    font-size: 3rem;
    color: #dee2e6;
}

.dashboard-table th {
    font-weight: 600;
    color: #495057;
    padding: 1rem 1.25rem;
}

.dashboard-table td {
    padding: 1rem 1.25rem;
}

/* Image preview */
.img-thumbnail {
    border-radius: 10px;
}

/* Table styles */
.table-hover tbody tr:hover {
    background-color: rgba(46, 204, 113, 0.1);
}

/* Badge styles */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Media mutual exclusion styling */
.media-section {
    position: relative;
    transition: opacity 0.3s ease;
}

.media-section.media-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.media-section.media-disabled .form-control,
.media-section.media-disabled .form-select,
.media-section.media-disabled .form-check-input {
    pointer-events: none;
}

.media-exclusion-alert {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

/* ==========================================
   Custom Video Player Styles
   ========================================== */
.custom-video-player {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.custom-video-element {
    width: 100%;
    display: block;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 40px 15px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-video-player:hover .video-controls,
.video-controls:hover {
    opacity: 1;
}

/* Show controls when paused */
.custom-video-element:pause + .video-controls,
.custom-video-element[paused] + .video-controls {
    opacity: 1;
}

.progress-bar-container {
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 10px;
    position: relative;
}

.progress-bar-container:hover {
    height: 7px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 100%;
}

.progress-filled {
    height: 100%;
    background: var(--primary-green);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

/* Hover effect on progress bar */
.progress-bar-container:hover .progress-filled {
    background: var(--dark-green);
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255,255,255,0.2);
}

.control-btn:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

.control-btn.active {
    color: var(--primary-green);
}

.control-btn i {
    font-size: 1.25rem;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.volume-control input[type="range"] {
    width: 60px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

.volume-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

.volume-control input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.time-display {
    color: white;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.speed-control #speedDisplay {
    color: white;
    font-weight: 500;
    font-size: 14px;
}

/* Hide controls on mobile when playing */
@media (max-width: 768px) {
    .controls-left, .controls-right {
        gap: 5px;
    }

    .control-btn {
        padding: 6px;
    }

    .control-btn i {
        font-size: 1rem;
    }

    .time-display {
        font-size: 12px;
    }

    .volume-control input[type="range"] {
        width: 40px;
    }

    .video-controls {
        padding: 30px 10px 10px;
    }
}

/* Ensure video is responsive */
.custom-video-element {
    max-height: 500px;
    width: 100%;
}

/* For smaller cards */
@media (max-width: 768px) {
    .custom-video-element {
        max-height: 300px;
    }
}
