/* General styling */
body {
    overflow-x: hidden;
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
}

/* Header styling */
.card-header {
    background: #7b4397;
    background: -webkit-linear-gradient(to right, #333399, #ff00cc);
    background: linear-gradient(to right, #333399, #ff00cc);
    margin-bottom: 30px;
    border: none;
    border-radius: 0;
}

.header-text {
    font-size: calc(25px + 1vw);
    color: white;
    margin: 15px 0 5px 0;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    max-width: 700px;
    margin: 0 auto 20px auto;
    padding: 0 20px;
    font-size: calc(13px + 0.3vw);
    line-height: 1.6;
}

/* Main content container - Fixed positioning */
.main-content {
    margin-left: 270px;
    padding: 0 20px;
    max-width: calc(100% - 290px);
    transition: margin-left 0.3s ease;
}

/* Modern card styling */
.counter-card, .stat-card, .milestone-card, .search-card, .sharing-card, .recent-card, .comments-card, .ad-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    background: #fff;
    margin-bottom: 25px;
    width: 100%;
}

.counter-card:hover, .stat-card:hover, .milestone-card:hover, .search-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.counter-card .card-body {
    padding: 30px;
}

/* Thumbnail styling - properly centered */
.thumbnail-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 0;
}

.video-thumbnail {
    max-width: 90%;
    max-height: 280px;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.video-thumbnail:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

/* Video title and channel name */
.video-title {
    font-size: calc(12px + 1.8vw);
    font-weight: 700;
    margin: 20px 0 10px 0;
    color: #2c3e50;
    line-height: 1.3;
}

.channel-name {
    font-size: calc(10px + 0.8vw);
    color: #7f8c8d;
    margin-bottom: 15px;
    font-weight: 500;
}

/* Live badge */
.live-badge {
    display: none;
    align-items: center;
    gap: 8px;
    background: #ff003c;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 6px 16px;
    border-radius: 20px;
    margin: 0 auto 20px auto;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(255, 0, 60, 0.35);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: liveDotPulse 1.5s infinite;
}

@keyframes liveDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.viewers-label {
    color: #6c757d;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Status panel: upcoming / not live / error / live without a count */
.status-panel {
    display: none;
    text-align: center;
    padding: 25px 20px 10px 20px;
}

.status-message {
    display: inline-block;
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    border-radius: 12px;
    padding: 18px 25px;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    max-width: 600px;
}

.status-panel.state-upcoming .status-message,
.status-panel.state-live-no-count .status-message {
    background: #cfe2ff;
    color: #084298;
    border-color: #b6d4fe;
}

/* Odometer styling - Improved mobile sizing */
.main-odo {
    font-size: calc(20px + 6vw);
    font-weight: 800;
    color: #2c3e50;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.bottom-odo {
    font-size: calc(14px + 1.2vw);
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    width: 100%;
    margin-top: 15px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stats card styling */
.stat-card .card-body {
    padding: 25px 20px;
    text-align: center;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-icon, .milestone-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #7b4397;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.stat-card h5, .milestone-card h5 {
    font-weight: 700;
    margin-bottom: 20px;
    color: #34495e;
    font-size: 1.1rem;
}

.stat-value {
    font-size: calc(14px + 1vw);
    font-weight: 700;
    color: #2c3e50;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced milestone-style card (reused for "Session Peak Viewers") */
.milestone-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.milestone-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

.milestone-card .card-body {
    position: relative;
    z-index: 1;
    padding: 35px 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    margin: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.milestone-card h5 {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.milestone-card .milestone-icon {
    color: #ffd700;
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
    animation: pulse 2s infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.milestone-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.current-views, .milestone-target {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.current-views:hover, .milestone-target:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.15);
}

.view-odo-small {
    font-size: calc(14px + 1.8vw);
    font-weight: 800;
    color: #ffd700;
    display: block;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.3));
}

.current-views small, .milestone-target small {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modern Progress Bar Design */
.milestone-progress {
    height: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    margin: 25px 0;
}

.milestone-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 20px 20px 0 0;
}

.milestone-progress .progress-bar {
    background: linear-gradient(90deg, #ffffff 0%, #ffd9ec 100%);
    height: 100%;
    border-radius: 18px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.milestone-progress .progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent);
    animation: progressFlow 3s infinite;
}

.milestone-progress .progress-bar::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 40%;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.4),
        rgba(255, 255, 255, 0.1));
    border-radius: 16px;
}

@keyframes progressFlow {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 800;
    color: #fff;
    font-size: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 2;
    letter-spacing: 0.5px;
}

.views-remaining {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.views-remaining .bottom-odo {
    color: #ffd700;
    font-size: calc(12px + 1.5vw);
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

.views-remaining small {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
    display: block;
}

/* Search / lookup section styling */
.search-card .card-body {
    padding: 30px;
}

.search-card h4 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 25px;
}

.search-input {
    border-radius: 25px 0 0 25px;
    padding: 15px 25px;
    border: 2px solid #e9ecef;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #7b4397;
    box-shadow: 0 0 0 0.2rem rgba(123, 67, 151, 0.25);
}

.search-button {
    background: linear-gradient(135deg, #333399, #ff00cc);
    border: none;
    border-radius: 0 25px 25px 0;
    padding: 15px 30px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 0, 204, 0.3);
}

#stream-input-message {
    display: none;
    color: #c0392b;
    font-size: 0.9rem;
    margin-top: 12px;
}

/* Recent streams styling */
.recent-card .card-body {
    padding: 30px;
}

.recent-card h4 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 25px;
}

.recent-video {
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.recent-video:hover {
    transform: translateY(-3px);
}

.recent-video-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.recent-video-link:hover {
    text-decoration: none;
    color: inherit;
}

.recent-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.recent-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.recent-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 45px;
    line-height: 1.4;
    color: #2c3e50;
}

/* Sharing section styling */
.sharing-card .card-body {
    padding: 30px;
}

.nav-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 25px;
}

.nav-tabs .nav-link {
    color: #7f8c8d;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 15px 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
    color: #7b4397;
    border-bottom: 3px solid #7b4397;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    color: #7b4397;
}

.copy-btn {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px 15px;
}

.copy-btn:hover {
    background-color: #7b4397;
    color: white;
}

.copy-success {
    background-color: #28a745 !important;
    color: white;
    transition: all 0.3s ease;
}

/* Comments card styling */
.comments-card .card-body {
    padding: 30px;
}

.comments-card h4 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 25px;
}

/* Ad container styling */
.ad-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    margin-bottom: 25px;
    transition: opacity 0.5s ease;
}

.ad-container {
    padding: 15px;
    text-align: center;
    position: relative;
}

.ad-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 500;
}

.adsbygoogle {
    display: block;
    min-height: 100px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Sticky ad for mobile */
.sticky-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border-top: 2px solid #e9ecef;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: none;
}

.sticky-ad .ad-container {
    padding: 10px;
}

.sticky-ad-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    z-index: 1001;
}

/* Enhanced Sidebar styling */
ul {
    list-style-type: none;
    margin: 0;
    padding: 20px 0;
    color: #2c3e50;
    width: 250px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 3px 0 20px rgba(0,0,0,0.08);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1000;
    border-right: 3px solid #e9ecef;
}

.nav-title {
    padding: 15px 20px 10px 20px;
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: #7b4397;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 10px;
}

.nav-title2 {
    padding: 20px 20px 10px 20px;
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: #7b4397;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 10px;
    margin-top: 20px;
}

.link, .link2 {
    display: block;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
    transition: all 0.3s ease;
    border-radius: 0 25px 25px 0;
    margin: 2px 0;
    margin-right: 10px;
}

.link:hover, .link2:hover {
    color: #7b4397;
    background: linear-gradient(90deg, transparent 0%, rgba(123, 67, 151, 0.1) 100%);
    transform: translateX(5px);
    text-decoration: none;
}

.link i, .link2 i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.link a, .link2 a {
    color: inherit;
    text-decoration: none;
}

.link a:hover, .link2 a:hover {
    color: inherit;
    text-decoration: none;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ff00cc;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* FAQ Section Styling */
.faq-card .card-body {
    padding: 30px;
}

.faq-card h4 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 30px;
}

.faq-item {
    border: none;
    margin-bottom: 10px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.faq-item .card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: none;
    padding: 0;
}

.faq-item .btn-link {
    width: 100%;
    text-align: left;
    padding: 20px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    border: none;
    background: none;
    transition: all 0.3s ease;
}

.faq-item .btn-link:hover {
    color: #7b4397;
    text-decoration: none;
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
}

.faq-item .btn-link:focus {
    box-shadow: none;
    outline: none;
}

.faq-item .btn-link[aria-expanded="true"] {
    color: #7b4397;
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
}

.faq-item .btn-link i {
    color: #7b4397;
    transition: transform 0.3s ease;
}

.faq-item .btn-link[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.faq-item .card-body {
    padding: 20px;
    background-color: #fff;
    color: #555;
    line-height: 1.6;
    border-top: 2px solid #f8f9fa;
}

/* Responsive design adjustments - Fixed */
@media screen and (max-width: 1252px) {
    ul {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 0 15px;
    }
}

@media screen and (max-width: 768px) {
    .card-header {
        display: none;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 0 10px;
    }

    .video-thumbnail {
        max-height: 200px;
    }

    .main-odo {
        font-size: calc(18px + 8vw);
    }

    .bottom-odo {
        font-size: calc(16px + 2vw);
        min-height: 50px;
    }

    .stat-card {
        margin-bottom: 15px;
    }

    .stat-card .card-body {
        padding: 20px 15px;
        min-height: 160px;
    }

    .counter-card .card-body, .search-card .card-body, .sharing-card .card-body {
        padding: 20px;
    }

    .recent-thumbnail {
        height: 100px;
    }

    .ad-card {
        margin-bottom: 15px;
    }

    .ad-container {
        padding: 10px;
    }

    .sticky-ad {
        display: block;
    }

    .adsbygoogle {
        min-height: 50px;
    }

    ul {
        transform: translateX(-100%);
    }

    /* Better mobile spacing */
    .row {
        margin: 0 -5px;
    }

    .row > [class*="col-"] {
        padding: 0 5px;
    }

    .milestone-info {
        flex-direction: column;
        gap: 15px;
    }

    .view-odo-small {
        font-size: calc(10px + 2vw);
    }

    .progress-text {
        font-size: 0.8rem;
    }

    .faq-item .btn-link {
        padding: 15px;
        font-size: 0.95rem;
    }

    .faq-item .card-body {
        padding: 15px;
        font-size: 0.9rem;
    }

    .status-message {
        padding: 15px 18px;
        font-size: 0.92rem;
    }
}

@media screen and (max-width: 500px) {
    .header-text {
        font-size: calc(18px + 1vw);
    }

    .main-content {
        padding: 0 5px;
    }

    .bottom-odo {
        font-size: calc(18px + 2.5vw);
        min-height: 55px;
    }

    .main-odo {
        font-size: calc(20px + 10vw);
    }

    .stat-card .card-body {
        padding: 15px 10px;
        min-height: 140px;
    }

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

    .search-input, .search-button {
        padding: 12px 20px;
    }

    .counter-card .card-body {
        padding: 15px;
    }

    .milestone-card .milestone-icon {
        font-size: 2.5rem;
    }

    .milestone-progress {
        height: 20px;
    }

    .progress-text {
        font-size: 0.7rem;
    }
}

/* Extra small devices */
@media screen and (max-width: 375px) {
    .bottom-odo {
        font-size: calc(20px + 3vw);
        min-height: 60px;
    }

    .main-odo {
        font-size: calc(22px + 12vw);
    }

    .stat-card .card-body {
        min-height: 120px;
        padding: 12px 8px;
    }

    .stat-card h5 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
}

/* Accessibility improvements */
.odometer {
    font-weight: bold;
}

input:focus, button:focus {
    outline: 2px solid #7b4397;
    outline-offset: 2px;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(123, 67, 151, 0.25);
}

/* Smooth scrolling for better UX */
html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #333399, #ff00cc);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff00cc, #333399);
}
