* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #212631;
    color: white;
    position: relative;
    margin: 0;
    padding-bottom: 60px; /* Height of footer */
}

.main-content {
    flex: 1 0 auto;
    width: 100%;
}

.header {
    text-align: center;
    padding: 1rem 2rem;
    background: rgba(33, 38, 49, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.social-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2em;
}

.social-link:hover {
    color: white;
    background: rgba(255, 59, 59, 0.1);
}

.social-link.app {
    background: #ff3b3b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.social-link.app:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 59, 59, 0.3);
    background: #ff5252;
}

@media (max-width: 992px) {
    .social-link span {
        display: none;
    }
    
    .social-link.app span {
        display: inline;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-left {
        width: 100%;
        justify-content: center;
    }

    .social-links {
        width: 100%;
        justify-content: center;
    }
    
}

.logo {
    width: 200px;
    height: auto;
    display: flex;
    align-items: center;
}

.logo img {
    width: 100%;
    height: auto;
}

.header-text {
    text-align: left;
    display: block; /* Show the text since we're using it now */
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.header p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    margin: 0;
}

#total-cameras {
    color: #ff3b3b;
    font-weight: 600;
}

@media (max-width: 992px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-left {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }

    .header-text {
        text-align: center;
        margin-top: 0.5rem;
    }

    .social-links {
        width: 100%;
        justify-content: center;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
}

.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: white;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    min-height: 300px;
    justify-content: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    background: rgba(33, 38, 49, 0.95);
    z-index: 1000;
}

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

#loading-text {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    transition: opacity 0.5s ease;
    min-height: 1.5em;
    display: block;
    font-size: 1.4rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    margin: 0 auto;
}

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

@keyframes fadeInOut {
    0% { opacity: 0.5; transform: translateY(5px); }
    50% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0.5; transform: translateY(5px); }
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.camera-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    padding-bottom: 1rem; /* Add some space at bottom */
}

.camera-item {
    background: rgba(33, 38, 49, 0.95);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.camera-item {
    cursor: pointer;
}

.camera-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.camera-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
    position: relative;
}

.camera-item:hover .camera-image {
    transform: scale(1.05);
}

/* Image loading states */
.camera-image.loading {
    opacity: 0.7;
    filter: grayscale(0.3);
}

.camera-image.retrying {
    opacity: 0.8;
    filter: sepia(0.5) hue-rotate(30deg);
    animation: pulse 2s infinite;
}

.camera-image.loaded {
    opacity: 1;
    filter: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.6; }
}



.favorite-heart {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.favorite-heart:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.1);
}

.favorite-heart.favorited {
    color: #ff3b3b;
    background: rgba(255, 59, 59, 0.1);
}

.share-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    transition: all 0.2s ease;
    margin-left: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.1);
}

.share-button.copied {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.share-button.active {
    color: #ff3b3b;
    background: rgba(255, 59, 59, 0.1);
}

.playback-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    transition: all 0.2s ease;
    margin-left: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.playback-button:hover {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    transform: scale(1.1);
}

.playback-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.playback-button.loading {
    color: #FFC107;
    background: rgba(255, 193, 7, 0.1);
}

.playback-button.success {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.playback-button.error {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

/* Share Options Popup */
.share-options {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #212631;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    min-width: 160px;
    margin-bottom: 0.5rem;
}

.share-options.show {
    display: block;
    animation: sharePopupFadeIn 0.2s ease-out;
}

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

.share-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.share-option:hover {
    background: rgba(255, 59, 59, 0.1);
    color: #ff3b3b;
}

.share-option-icon {
    font-size: 1rem;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toast {
    background: #212631;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-top: 0.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    max-width: 400px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #212631 0%, rgba(76, 175, 80, 0.1) 100%);
}

.toast.error {
    border-color: #ff3b3b;
    background: linear-gradient(135deg, #212631 0%, rgba(255, 59, 59, 0.1) 100%);
}

.toast.info {
    border-color: #2196F3;
    background: linear-gradient(135deg, #212631 0%, rgba(33, 150, 243, 0.1) 100%);
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #4CAF50;
}

.toast.error .toast-icon {
    color: #ff3b3b;
}

.toast.info .toast-icon {
    color: #2196F3;
}

@media (max-width: 768px) {
    .toast-container {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 20px);
        max-width: 400px;
    }
    
    .toast {
        width: 100%;
        max-width: none;
        font-size: 0.85rem;
        padding: 0.875rem 1.25rem;
    }
}

.camera-region-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.camera-info {
    padding: 1.25rem;
}

.camera-name {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.camera-region {
    font-size: 0.875rem;
    color: white;
    font-weight: 500;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.region-badge-Belfast {
    background: #ff3b3b;
}

.region-badge-North-East {
    background: #4CAF50;
}

.region-badge-North-West {
    background: #2196F3;
}

.region-badge-South-East {
    background: #FFC107;
}

.region-badge-South-West {
    background: #9C27B0;
}

.image-error {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 0.875rem;
    text-align: center;
    flex-direction: column;
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.search-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
    outline: none;
    border-color: #ff3b3b;
    box-shadow: 0 0 0 3px rgba(255, 59, 59, 0.1);
}

.search-icon {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.2rem;
}

.stats {
    background: rgba(33, 38, 49, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #ff3b3b;
    margin-bottom: 0.25rem;
}

.stat-item p {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .camera-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .camera-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .camera-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .container {
        padding: 0 1rem 2rem;
    }
    
    .header {
        padding: 0.75rem;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .map-button, .regions-button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        margin: 0.25rem;
    }
    
    .regions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .camera-grid {
        grid-template-columns: 1fr;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-in forwards;
}

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

.map-button, .regions-button, .search-button, .favorites-button, .nearest-button {
    background: #ff3b3b;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    margin: 0 0.5rem;
}

.map-button:hover, .regions-button:hover, .search-button:hover, .favorites-button:hover, .nearest-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 59, 59, 0.3);
    background: #ff5252;
}







/* Update the map-button-container styles */
.map-button-container {
    text-align: center;
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.regions-filter {
    background: rgba(33, 38, 49, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    animation: slideDown 0.3s ease-out;
}

.regions-filter.show {
    display: block;
}

.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.region-checkbox {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.region-checkbox:hover {
    background: rgba(255, 59, 59, 0.1);
}

.region-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.region-checkbox label {
    cursor: pointer;
    font-weight: 500;
    color: white;
}

.map-container {
    margin-top: 1.5rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    animation: slideDown 0.3s ease-out;
}

.map-container.show {
    display: block;
}

#map {
    height: 500px;
    width: 100%;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Leaflet Dark Theme Overrides */
.leaflet-container {
    background: #212631 !important;
}

.leaflet-popup-content-wrapper {
    background: #212631;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 300px;
    width: 300px;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 100% !important;
}

.map-popup {
    padding: 0;
}

.map-popup h4 {
    padding: 10px 15px;
    margin: 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.map-popup .region {
    padding: 5px 15px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.map-popup .image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.map-popup .image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.map-popup .expand-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(33, 38, 49, 0.8);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.map-popup .expand-button:hover {
    background: #ff3b3b;
    transform: scale(1.1);
}

.map-popup .image-error {
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.2);
}

.leaflet-popup-tip {
    background: #212631;
}

.leaflet-bar a {
    background: #212631;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaflet-bar a:hover {
    background: #2c3340;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    color: white !important;
}

.info.legend {
    background: #212631 !important;
    color: white !important;
}

.map-header {
    background: #212631;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid rgba(255, 59, 59, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-title {
    font-weight: 600;
    color: white;
}

.close-map {
    background: rgba(255, 59, 59, 0.1);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-map:hover {
    background: #ff3b3b;
    transform: scale(1.1);
}

/* Custom marker styles */
.camera-marker {
    background: #667eea;
    border: 3px solid white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.camera-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
}

/* Footer styles */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(33, 38, 49, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    text-align: center;
    border-top: 2px solid rgba(255, 59, 59, 0.2);
    z-index: 99;
    display: block;
}

.footer-content {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.footer-content span {
    color: #ff3b3b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .footer {
        padding: 0.75rem 0;
    }
    .footer-content {
        font-size: 0.8rem;
    }
}

/* Search box styles */
.search-box {
    background: rgba(33, 38, 49, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    animation: slideDown 0.3s ease-out;
}

.search-box.show {
    display: block;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.search-input:focus {
    outline: none;
    border-color: #ff3b3b;
    box-shadow: 0 0 0 3px rgba(255, 59, 59, 0.1);
}

/* Update button styles for mobile */
@media (max-width: 768px) {
            .map-button, .regions-button, .search-button, .favorites-button, .nearest-button {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    min-width: auto;
}
    
    .map-button-container {
        margin: 1rem 0;
        padding: 0 0.5rem;
    }
    
    /* Make the container scrollable if needed */
    .container {
        padding: 0 0.5rem 2rem;
    }
    
    /* Adjust camera grid spacing */
    .camera-grid {
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    /* Adjust camera item styles */
    .camera-item {
        border-radius: 12px;
    }
    
    .camera-info {
        padding: 0.75rem;
    }
    
    .camera-name {
        font-size: 0.9rem;
    }
    
    .camera-region {
        font-size: 0.8rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* Adjust header spacing */
    .header {
        padding: 0.75rem 1rem;
    }
    
    .header-text h1 {
        font-size: 1.1rem;
    }
    
    .header-text p {
        font-size: 0.8rem;
    }
    
    /* Adjust search box padding */
    .search-box {
        margin: 0.75rem 0;
        padding: 0.75rem;
    }
    
    .search-input {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Adjust regions filter spacing */
    .regions-filter {
        margin: 0.75rem 0;
        padding: 0.75rem;
    }
    
    .regions-grid {
        gap: 0.5rem;
    }
    
    .region-checkbox {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* Add styles for very small screens */
@media (max-width: 360px) {
    .map-button, .regions-button, .search-button, .favorites-button, .nearest-button {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .map-button-container {
        gap: 0.25rem;
    }
}

/* Add floating button styles */
/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(33, 38, 49, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #212631;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.7) translateY(50px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 0.75rem 1.25rem;
    background: #212631;
    border-bottom: 2px solid rgba(255, 59, 59, 0.2);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    color: white;
}

.modal-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.modal-close, .modal-fullscreen {
    background: rgba(255, 59, 59, 0.1);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover, .modal-fullscreen:hover {
    background: #ff3b3b !important;
    transform: scale(1.1);
}

.modal-favorite, .modal-share {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-favorite:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-favorite.favorited {
    color: #ff3b3b;
    background: rgba(255, 59, 59, 0.1);
}

.modal-share:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-share.active {
    color: #ff3b3b;
    background: rgba(255, 59, 59, 0.1);
}

.modal-playback {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.9) 0%, rgba(69, 160, 73, 0.8) 100%);
    border: 1px solid rgba(76, 175, 80, 0.6);
    color: white;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.modal-playback::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.modal-playback:hover {
    background: linear-gradient(135deg, rgba(102, 187, 106, 1) 0%, rgba(76, 175, 80, 0.9) 100%);
    border-color: rgba(76, 175, 80, 0.8);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.modal-playback:hover::before {
    left: 100%;
}

.modal-playback:active {
    transform: translateY(0) scale(0.98);
    transition: all 0.1s ease;
}

.modal-playback.active {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    border-color: #FF9800;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.modal-playback.active:hover {
    background: linear-gradient(135deg, #FFB74D 0%, #FF9800 100%);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
}

.modal-share-options {
    position: absolute;
    top: 100%;
    right: 0;
    background: #212631;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    display: none;
    min-width: 160px;
    margin-top: 0.5rem;
}

.modal-share-options.show {
    display: block;
    animation: sharePopupFadeIn 0.2s ease-out;
}

.modal-fullscreen {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

.modal-fullscreen:hover {
    transform: scale(1.1) !important;
}

/* Fullscreen mode styles */
.modal-content.fullscreen {
    max-width: 100%;
    max-height: 100%;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.modal-content.fullscreen .modal-image-container {
    height: calc(100vh - 48px);
    min-height: auto;
}

.modal-image-container {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 400px;
    background: #1a1f27;
}

.modal-content.fullscreen .modal-image-container::after {
    width: 200px;
    height: 200px;
    bottom: 30px;
    right: 30px;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
    z-index: 0;
    transform-origin: center center;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1002;
}

.zoom-btn {
    background: rgba(33, 38, 49, 0.8);
    border: 2px solid rgba(255, 59, 59, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.zoom-btn:hover {
    background: rgba(255, 59, 59, 0.2);
    border-color: rgba(255, 59, 59, 0.6);
    transform: scale(1.1);
}

.zoom-btn:active {
    transform: scale(0.95);
}

/* PTZ Controls */
.ptz-controls {
    position: absolute;
    right: 10px;
    bottom: 100px;
    display: none;
    z-index: 1002;
}

.ptz-controls.visible {
    display: block;
}

.ptz-pan {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ptz-pan-horizontal {
    display: flex;
    gap: 0.5rem;
}

.ptz-btn {
    background: rgba(33, 38, 49, 0.8);
    border: 2px solid rgba(255, 59, 59, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.ptz-btn:hover {
    background: rgba(255, 59, 59, 0.2);
    border-color: rgba(255, 59, 59, 0.6);
    transform: scale(1.1);
}

.ptz-btn:active {
    transform: scale(0.95);
}

.ptz-btn.pan-center {
    background: rgba(255, 59, 59, 0.3);
    border-color: rgba(255, 59, 59, 0.6);
}

.ptz-btn.help-btn {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
    margin-top: 0.5rem;
}

.ptz-btn.help-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.8);
}

/* Zoomed image styles */
.modal-image.zoomed {
    cursor: grab;
}

.modal-image.zoomed:active {
    cursor: grabbing;
}

/* Zoom indicator */
.zoom-indicator {
    position: absolute;
    top: 10px;
    right: 60px;
    background: rgba(33, 38, 49, 0.8);
    border: 2px solid rgba(255, 59, 59, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: none;
    z-index: 1002;
    backdrop-filter: blur(10px);
}

.zoom-indicator.visible {
    display: block;
}

/* Smooth transitions for zoom */
.modal-image-container {
    overflow: hidden;
}

/* Enhanced zoom controls positioning */
.zoom-controls {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.zoom-controls:hover {
    opacity: 1;
}

/* Mobile responsive - hide zoom and playback on small screens */
@media (max-width: 768px) {
    .zoom-controls,
    .ptz-controls,
    .zoom-indicator,
    .boundary-indicator,
    .modal-playback,
    .playback-interface {
        display: none !important;
    }
    
    /* Show mobile info banner */
    .mobile-info-banner {
        display: block !important;
    }
    
    /* Adjust modal layout for mobile */
    .modal-content {
        padding: 1rem;
    }
    
    .modal-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .modal-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Mobile-specific modal adjustments */
    .modal-image-container {
        height: calc(100vh - 120px);
        min-height: 300px;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-subtitle {
        font-size: 0.9rem;
    }
}

/* Tablet responsive - show controls but adjust sizing */
@media (min-width: 769px) and (max-width: 1024px) {
    .zoom-controls {
        transform: scale(0.9);
    }
    
    .ptz-controls {
        transform: scale(0.9);
    }
    
    .zoom-btn,
    .ptz-btn {
        width: 35px;
        height: 35px;
    }
}

/* Boundary indicator */
.boundary-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 59, 59, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: none !important;
    z-index: 1003;
    backdrop-filter: blur(10px);
    animation: boundaryPulse 0.5s ease-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.boundary-indicator.show {
    display: block !important;
    opacity: 1;
}

/* Ensure boundary indicator is hidden by default */
.boundary-indicator:not(.show) {
    display: none !important;
    opacity: 0;
}

/* Mobile info banner */
.mobile-info-banner {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.8rem;
    display: none;
    z-index: 1003;
    backdrop-filter: blur(10px);
    text-align: center;
    max-width: 280px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mobile-info-banner p {
    margin: 0.2rem 0;
    line-height: 1.2;
}

.mobile-info-banner p:first-child {
    font-weight: bold;
    font-size: 0.85rem;
}

.mobile-info-banner p:last-child {
    font-size: 0.75rem;
    opacity: 0.95;
}

@keyframes boundaryPulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* PTZ controls enhanced positioning */
.ptz-controls {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.ptz-controls:hover {
    opacity: 1;
}

.modal-image.loading {
    opacity: 0.7;
}

.modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    display: none;
}

.modal-loading.show {
    display: block;
}

.modal-refresh-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 59, 59, 0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1rem;
    opacity: 0;
    transform: rotate(0deg);
    transition: all 0.3s ease;
}

.modal-refresh-indicator.refreshing {
    opacity: 1;
    transform: rotate(360deg);
    background: #ff3b3b;
}

/* Playback Interface - Styled to match page design */
.playback-interface {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(33, 38, 49, 0.3);
    border: 2px solid rgba(255, 59, 59, 0.2);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 1rem;
    display: none !important;
    z-index: 1001;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: visible;
    min-height: 75px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
}

/* Show playback interface only when active */
.playback-interface.show {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
}

/* Ensure playback interface is hidden by default */
.playback-interface:not(.show) {
    display: none !important;
    opacity: 0;
    transform: translateY(100%);
}

.playback-interface::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(255, 59, 59, 0.6) 0%, 
        rgba(255, 59, 59, 0.3) 50%, 
        rgba(255, 59, 59, 0.6) 100%);
}

.playback-interface::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(255, 59, 59, 0.02) 0%, 
        transparent 50%, 
        rgba(255, 59, 59, 0.02) 100%);
    pointer-events: none;
    z-index: -1;
}

.playback-interface.show {
    display: block;
}

/* Enhanced Playback Controls - Integrated with info section */
.playback-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
}

.playback-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.6rem;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.playback-btn i {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.playback-btn:hover i {
    color: white;
    transform: scale(1.1);
}

/* Specific icon sizing for different button types */
.playback-btn#prev-btn i,
.playback-btn#next-btn i {
    font-size: 0.9rem;
}

.playback-btn#loop-btn i,
.playback-btn#help-btn i {
    font-size: 0.9rem;
}

/* Enhanced button states with icons */
.playback-btn.play i {
    color: white;
}

.playback-btn.pause i {
    color: white;
}

.playback-btn#prev-btn i,
.playback-btn#next-btn i {
    color: rgba(255, 255, 255, 0.8);
}

.playback-btn#loop-btn i,
.playback-btn#help-btn i {
    color: rgba(255, 255, 255, 0.7);
}

.playback-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.playback-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 59, 59, 0.4);
    box-shadow: 0 8px 25px rgba(255, 59, 59, 0.25);
}

.playback-btn:hover::before {
    left: 100%;
}

.playback-btn:active {
    transform: translateY(0) scale(0.98);
    transition: all 0.1s ease;
}

.playback-btn.play {
    background: #ff3b3b;
    border-color: #ff3b3b;
    box-shadow: 0 4px 15px rgba(255, 59, 59, 0.3);
}

.playback-btn.play:hover {
    background: #ff5252;
    box-shadow: 0 8px 25px rgba(255, 59, 59, 0.4);
}

.playback-btn.play i,
.playback-btn.pause i {
    font-size: 1.1rem;
}

.playback-btn.pause {
    background: #ff8a65;
    border-color: #ff8a65;
    box-shadow: 0 4px 15px rgba(255, 138, 101, 0.3);
}

.playback-btn.pause:hover {
    background: #ff9a7a;
    box-shadow: 0 8px 25px rgba(255, 138, 101, 0.4);
}

.playback-btn#prev-btn,
.playback-btn#next-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.playback-btn#prev-btn:hover,
.playback-btn#next-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 59, 59, 0.4);
    box-shadow: 0 4px 15px rgba(255, 59, 59, 0.2);
}

.playback-btn#loop-btn.active {
    background: #ff3b3b;
    border-color: #ff3b3b;
    box-shadow: 0 4px 15px rgba(255, 59, 59, 0.3);
}

.playback-btn#loop-btn.active i {
    color: white;
}

.playback-btn#help-btn {
    background: linear-gradient(135deg, rgba(158, 158, 158, 0.8) 0%, rgba(117, 117, 117, 0.6) 100%);
    border-color: rgba(158, 158, 158, 0.6);
}

.playback-btn#help-btn:hover {
    background: linear-gradient(135deg, rgba(158, 158, 158, 1) 0%, rgba(117, 117, 117, 0.8) 100%);
    border-color: rgba(158, 158, 158, 0.8);
}

/* Clean Timeline Design - Complete Redesign */
.playback-timeline-container {
    margin: 1rem 0;
    padding: 15px 0;
    position: relative;
}

.playback-timeline {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: visible;
}

.playback-progress {
    height: 100%;
    background: #ff3b3b;
    border-radius: 4px;
    position: relative;
    transition: width 0.2s ease;
    box-shadow: 0 0 10px rgba(255, 59, 59, 0.4);
}



.playback-thumb {
    position: absolute;
    top: 50%;
    right: -12px;
    width: 24px;
    height: 24px;
    background: #ff3b3b;
    border-radius: 50%;
    border: 3px solid white;
    cursor: grab;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    z-index: 10;
}



.playback-thumb:active {
    cursor: grabbing;
    transform: translateY(-50%) scale(1.15);
}

.playback-thumb.dragging {
    background: #ff8a65;
    transform: translateY(-50%) scale(1.2);
}

/* Enhanced Playback Info - Styled to match page design */
.playback-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.05);
    gap: 1rem;
}

#playback-counter {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    background: rgba(255, 59, 59, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 2px solid rgba(255, 59, 59, 0.2);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Enhanced Speed Controls */
.playback-speed {
    display: flex;
    gap: 0.5rem;
}





/* Enhanced Scrub Preview Tooltip */
#scrub-preview {
    position: absolute;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 20, 20, 0.98) 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 1000;
    display: none;
    white-space: nowrap;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    transition: all 0.2s ease;
}

#scrub-preview::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(0, 0, 0, 0.95);
}

/* Enhanced Mobile Experience */
@media (max-width: 768px) {
    .playback-interface {
        padding: 0.75rem;
        margin-top: 0.5rem;
        min-height: 70px;
        border-radius: 16px 16px 0 0;
    }

    .playback-controls {
        gap: 0.5rem;
        margin-bottom: 0;
    }

    .playback-btn {
        min-width: 36px;
        height: 36px;
        padding: 0.4rem;
        font-size: 0.9rem;
    }

    .playback-thumb {
        width: 18px;
        height: 18px;
        right: -9px;
        top: -9px;
        z-index: 100;
    }

    .playback-timeline {
        height: 18px;
        margin: 0.4rem 0;
    }

    .playback-info {
        flex-direction: row;
        gap: 0.75rem;
        align-items: center;
        text-align: left;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
    }
}

/* Smooth animations for all elements */
.playback-interface * {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus states for accessibility */
.playback-btn:focus,
.speed-btn:focus {
    outline: 2px solid rgba(76, 175, 80, 0.6);
    outline-offset: 2px;
}

/* Loading state for buttons */
.playback-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.playback-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Mobile Modal Styles */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        border-radius: 16px;
    }

    .modal-header {
        padding: 1rem 1.5rem;
        flex-wrap: wrap;
        gap: 0.5rem;
        height: auto;
        min-height: 48px;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-subtitle {
        font-size: 0.8rem;
    }

    .modal-actions {
        gap: 0.25rem !important;
    }

    .modal-favorite, .modal-share, .modal-playback, .modal-fullscreen, .modal-close {
        width: 28px !important;
        height: 28px !important;
        font-size: 1rem !important;
    }

    .modal-share-options {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin-top: 0 !important;
        min-width: 200px;
    }

    .modal-image-container {
        height: 60vh;
        min-height: 300px;
    }
    
    /* Mobile playback interface adjustments */
    .playback-interface {
        padding: 0.75rem;
        min-height: 70px;
        border-radius: 16px 16px 0 0;
    }
    
    .playback-controls {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .playback-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .playback-info {
        font-size: 0.8rem;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        text-align: left;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .playback-timeline {
        height: 8px;
        margin: 0.4rem 0;
    }
    
    .playback-thumb {
        width: 20px;
        height: 20px;
        right: -10px;
        top: 50%;
        z-index: 10;
    }
}

.modal-share.active {
    color: #ff3b3b;
    background: rgba(255, 59, 59, 0.1);
}

.modal-playback {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-playback:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-playback i {
    font-size: 1rem;
    color: white;
    transition: all 0.2s ease;
}

.modal-playback:hover i {
    color: white;
}

.modal-playback.active {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.modal-playback.active i {
    color: #4CAF50;
}

.modal-share-options {
}

/* Enhanced Modal Content for Playback */
.modal-content.playback-mode {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 20, 20, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
}

.modal-content.playback-mode .modal-header {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(69, 160, 73, 0.05) 100%);
    border-bottom: 1px solid rgba(76, 175, 80, 0.2);
}

.modal-content.playback-mode .modal-title::before {
    content: '🎬 ';
    margin-right: 0.5rem;
}

/* Enhanced Image Container for Playback */
.modal-image-container.playback-mode {
    position: relative;
    overflow: hidden;
}

.modal-image-container.playback-mode::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(76, 175, 80, 0.02) 25%,
        rgba(76, 175, 80, 0.02) 75%,
        transparent 100%
    );
    pointer-events: none;
}

/* Enhanced Button States */
.playback-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.playback-btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Enhanced Timeline Interactions */
.playback-timeline:focus-within {
    border-color: rgba(76, 175, 80, 0.6);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Enhanced Progress Bar Animation */
.playback-progress {
    position: relative;
    overflow: hidden;
}

.playback-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

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

/* Enhanced Counter Display */
#playback-counter {
    position: relative;
    padding: 0.5rem 1rem;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(76, 175, 80, 0.2);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Enhanced Speed Button States */
.speed-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.speed-btn.active {
    position: relative;
    overflow: hidden;
}

.speed-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .playback-interface {
        border-radius: 12px 12px 0 0;
    }
    
    .playback-btn {
        min-width: 40px;
        height: 40px;
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    .playback-timeline {
        height: 8px;
        margin: 1rem 0;
    }
    
    .playback-thumb {
        width: 14px;
        height: 14px;
        right: -7px;
        top: -3px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .playback-btn {
        min-width: 48px;
        height: 48px;
        padding: 0.75rem;
    }
    
    .playback-thumb {
        width: 28px;
        height: 28px;
        right: -14px;
        top: 50%;
        z-index: 10;
    }
    
    .playback-timeline {
        height: 10px;
    }
}

/* Enhanced Focus States for Accessibility */
.playback-btn:focus-visible,
.speed-btn:focus-visible {
    outline: 2px solid rgba(76, 175, 80, 0.8);
    outline-offset: 3px;
    transform: scale(1.05);
}

/* Enhanced Loading States */
.playback-btn.loading {
    position: relative;
    color: transparent;
}

.playback-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced Hover Effects */
.playback-interface:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 15px 30px rgba(0, 0, 0, 0.25);
}



/* Enhanced Button Group Effects */
.playback-controls:hover .playback-btn:not(:hover) {
    opacity: 0.8;
    transform: scale(0.98);
}

.playback-controls:hover .playback-btn:hover {
    opacity: 1;
    transform: scale(1.02);
    z-index: 1;
}

/* News Modal Styles */
.news-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(33, 38, 49, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-modal-overlay.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.news-modal-content {
    background: #212631 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: 100vh !important;
    height: 100vh !important;
    box-shadow: none !important;
    transform: scale(0.7) translateY(50px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
}

.news-modal-overlay.show .news-modal-content {
    transform: scale(1) translateY(0);
}

.news-modal-header {
    background: linear-gradient(135deg, #ff3b3b 0%, #ff5252 100%);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-modal-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.news-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.news-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.news-modal-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.news-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.news-item-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 59, 59, 0.1);
    border-radius: 12px;
    border: 2px solid rgba(255, 59, 59, 0.2);
}

.news-item-content {
    flex: 1;
}

.news-item-content h3 {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.news-item-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.news-item-content strong {
    color: #ff3b3b;
    font-weight: 600;
}

.news-modal-footer {
    padding: 1.5rem 2rem;
    background: rgba(33, 38, 49, 0.5);
    display: flex;
    justify-content: center;
}

.news-modal-dismiss {
    background: #ff3b3b;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.news-modal-dismiss:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 59, 59, 0.3);
}

/* News Icon in Footer */
.news-icon {
    background: rgba(255, 59, 59, 0.1);
    border: 2px solid rgba(255, 59, 59, 0.3);
    color: #ff3b3b;
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 1rem;
    position: relative;
}

.news-icon:hover {
    background: rgba(255, 59, 59, 0.2);
    border-color: #ff3b3b;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 59, 59, 0.3);
}

.news-icon.has-updates::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #ff3b3b;
    border-radius: 50%;
    border: 2px solid #212631;
    animation: pulse 2s infinite;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .news-modal-content {
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
    }

    .news-modal-header {
        padding: 1rem 1.5rem;
    }

    .news-modal-title {
        font-size: 1.25rem;
    }

    .news-modal-body {
        padding: 1rem;
        gap: 1rem;
    }

    .news-item {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 1rem;
    }

    .news-item-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin: 0 auto;
    }

    .news-item-content h3 {
        font-size: 1.1rem;
    }

    .news-item-content p {
        font-size: 0.9rem;
    }

    .news-modal-footer {
        padding: 1rem 1.5rem;
    }

    .news-modal-dismiss {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .news-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        margin-left: 0.5rem;
    }
}