/*
Theme Name: Tamil Television Network
Theme URI: https://example.com/
Author: TTN
Description: Dark TV-style theme for Tamil Television Network with live and VOD support.
Version: 1.0.2
Text Domain: ttn-television
*/

:root {
    --primary: #e50914;
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --text-main: #ffffff;
    --text-gray: #b3b3b3;
    --whatsapp: #25D366;
    --facebook: #1877F2;
    --twitter: #1DA1F2;
}

* {
    box-sizing: border-box;
}

html {
    margin: 0 !important;
    padding: 0 !important;
}

body,
body.ttn-television,
body.custom-background {
    font-family: 'Roboto', sans-serif !important;
    background-color: var(--bg-dark) !important;
    color: var(--text-main) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

/* Override WordPress wrapper styles */
.ttn-site {
    background-color: var(--bg-dark) !important;
    min-height: 100vh;
}

a {
    color: var(--text-main);
    text-decoration: none;
}

a:hover {
    color: var(--primary);
}

/* Header */
nav.ttn-header,
header.ttn-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 15px 4% !important;
    background: #000 !important;
    border-bottom: 1px solid #333 !important;
    margin: 0 !important;
    width: 100% !important;
}

.ttn-header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 900;
    font-size: 24px;
    color: white;
    text-transform: uppercase;
}

.logo span {
    color: var(--primary);
}

/* --- Customizing Video.js Theme --- */
.video-js .vjs-big-play-button {
    background-color: rgba(229, 9, 20, 0.8); /* Red Brand Color */
    border-color: rgba(229, 9, 20, 0.8);
    width: 70px;
    height: 70px;
    border-radius: 50%; /* Circle button */
    line-height: 70px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.video-js .vjs-control-bar {
    background-color: rgba(0,0,0,0.7);
}

.video-js .vjs-play-progress {
    background-color: var(--primary);
}

/* Player */
.player-container {
    max-width: 1200px;
    margin: 0 auto;
    background: black;
    position: relative;
}

/* VIDEO INFO & SHARE BAR */
.video-meta-panel {
    background-color: var(--bg-panel);
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    border-bottom: 1px solid #333;
    max-width: 1200px;
    margin: 0 auto;
}

.video-text {
    flex: 1;
    min-width: 200px;
}

.video-text h1 {
    margin: 0 0 5px 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.video-text p {
    color: var(--text-gray);
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.share-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.share-actions .btn-share {
    flex-shrink: 0;
}

/* Share Buttons Styling */
.share-actions .btn-share,
button.btn-share {
    border: none !important;
    color: white !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    transition: transform 0.2s ease, opacity 0.2s ease !important;
    text-decoration: none !important;
    font-family: inherit !important;
    padding: 0 !important;
    line-height: 1 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.share-actions .btn-share:hover,
.share-actions .btn-share:focus,
button.btn-share:hover,
button.btn-share:focus {
    transform: scale(1.1) !important;
    opacity: 0.9 !important;
    outline: none !important;
}

.share-actions .btn-share:active,
button.btn-share:active {
    transform: scale(0.95) !important;
}

/* Native Share Button (wider, pill-shaped) */
.share-actions .btn-share.share-native,
button.btn-share.share-native {
    background: #e50914 !important;
    width: auto !important;
    min-width: auto !important;
    padding: 0 20px !important;
    border-radius: 20px !important;
    font-weight: bold !important;
    font-size: 14px !important;
    display: none !important; /* Hidden by default, shown via JS if supported */
}

.share-actions .btn-share.share-native i,
button.btn-share.share-native i {
    margin-right: 8px !important;
}

/* Individual Social Media Buttons */
.share-actions .btn-share.share-wa,
button.btn-share.share-wa {
    background: #25D366 !important;
}

.share-actions .btn-share.share-fb,
button.btn-share.share-fb {
    background: #1877F2 !important;
}

.share-actions .btn-share.share-x,
button.btn-share.share-x {
    background: #1DA1F2 !important;
}

.share-actions .btn-share.share-copy,
button.btn-share.share-copy {
    background: #444 !important;
}

/* Ensure icons are visible */
.share-actions .btn-share i,
.share-actions .btn-share i.fas,
.share-actions .btn-share i.fab,
button.btn-share i,
button.btn-share i.fas,
button.btn-share i.fab {
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    color: white !important;
}

/* DATE CONTROL BAR */
.controls-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    background-color: transparent;
}

.quick-links {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    flex-wrap: nowrap;
    padding-bottom: 5px;
}

.quick-links::-webkit-scrollbar {
    height: 4px;
}

.quick-links::-webkit-scrollbar-track {
    background: transparent;
}

.quick-links::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 2px;
}

.btn-pill {
    background: #333;
    color: white;
    border: 1px solid #444;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-pill:hover,
.btn-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: bold;
}

.date-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Styling the native Date Input */
input[type="date"] {
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    cursor: pointer;
}

/* Make calendar icon white in Webkit browsers */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.controls-bar label {
    color: #aaa;
    font-size: 14px;
}

/* Grid */
.content-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    min-height: 500px;
}

.date-heading {
    border-left: 4px solid var(--primary);
    padding-left: 15px;
    margin-bottom: 20px;
    font-size: 22px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-panel);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
}

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

.card-img {
    height: 140px;
    background: #333;
    position: relative;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    color: white;
    opacity: 0;
    transition: 0.2s;
}

.card:hover .card-play-icon {
    opacity: 1;
}

.card-info {
    padding: 12px;
}

.card-title {
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.4;
    color: var(--text-main);
}

.card-meta {
    font-size: 12px;
    color: var(--text-gray);
}

/* Spinner */
.loader {
    display: none;
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: var(--primary);
}

/* Main wrapper */
.ttn-main {
    flex: 1;
    background-color: var(--bg-dark) !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Footer */
.ttn-footer {
    border-top: 1px solid #333;
    background-color: #000;
    color: var(--text-gray);
    font-size: 0.8rem;
    padding: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .quick-links {
        justify-content: flex-start;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .btn-pill {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .date-picker-wrapper {
        justify-content: center;
        width: 100%;
    }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .video-meta-panel {
        flex-direction: column;
        padding: 15px;
    }
    
    .video-text {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .share-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }
    
    .btn-share {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    /* On mobile, standard share buttons are okay, but Native is better */
    .btn-share.share-native {
        display: inline-flex !important;
        height: 38px;
        padding: 0 16px;
        font-size: 13px;
    }
    
    .btn-share.share-native i {
        margin-right: 6px;
    }
}
