/* Custom CSS for Instagram Archive Browser - Dark Theme */

/* BBH Sans Bartle Font */
@font-face {
    font-family: 'BBH Sans Bartle';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url('https://cdn.jsdelivr.net/fontsource/fonts/bbh-sans-bartle@latest/latin-400-normal.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/fontsource/fonts/bbh-sans-bartle@latest/latin-400-normal.woff') format('woff');
    unicode-range: U+0000-00FF;
}

/* Global Styles */
body {
    background-color: #000000;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Welcome Header Styling */
.welcome-header {
    font-family: 'BBH Sans Bartle', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 400;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #ffffff 0%, #e6e6e6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    position: relative;
}

/* Fallback for browsers that don't support background-clip: text */
@supports not (-webkit-background-clip: text) {
    .welcome-header {
        color: #ffffff;
    }
}


/* Responsive adjustments for welcome header */
@media (max-width: 768px) {
    .welcome-header {
        font-size: 2.5rem;
        letter-spacing: -0.005em;
    }
}

@media (max-width: 480px) {
    .welcome-header {
        font-size: 2rem;
        letter-spacing: 0;
    }
}

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

.navbar-logo {
    height: 32px;
    width: auto;
    filter: brightness(1.1);
    transition: filter 0.2s ease;
}

.navbar-brand:hover .navbar-logo {
    filter: brightness(1.3);
}

.navbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
}

/* Content Cards */
.content-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid #333333;
    border-radius: 12px;
    overflow: hidden;
    background-color: #111111;
    color: #ffffff;
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1) !important;
    border-color: #555555;
}

/* Thumbnail Container - 9:16 Aspect Ratio */
.thumbnail-container {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%; /* 16/9 * 100% = 177.78% for 9:16 ratio */
    overflow: hidden;
    background: #222222;
}

.thumbnail-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

/* Clickable thumbnail link */
.thumbnail-link {
    text-decoration: none;
    display: block;
    position: relative;
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    outline: none;
}

/* Focus styles for accessibility */
.thumbnail-link:focus {
    outline: 2px solid #4dabf7;
    outline-offset: 2px;
}

.thumbnail-link:focus::after {
    background: rgba(77, 171, 247, 0.1);
}

.thumbnail-link:hover .thumbnail-img {
    transform: scale(1.05);
}

.content-card:hover .thumbnail-img {
    transform: scale(1.05);
}

/* Hover effect on thumbnail link */
.thumbnail-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
    transition: background 0.3s ease;
    z-index: 1;
}

.thumbnail-link:hover::after {
    background: rgba(255, 255, 255, 0.15);
}

/* Subtle click indicator */
.thumbnail-link:hover::before {
    content: '👁';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    opacity: 0.8;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Media Indicators */
.media-indicators {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    pointer-events: none;
}

.media-indicators .badge {
    margin-left: 4px;
    font-size: 0.7rem;
    border-radius: 12px;
    pointer-events: auto;
}

/* Card Body */
.card-body {
    padding: 1rem;
    background-color: #111111;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: #ffffff;
}

.card-metadata {
    font-size: 0.85rem;
}

.card-metadata small {
    margin-bottom: 2px;
    color: #cccccc;
}

.text-muted {
    color: #888888 !important;
}

/* Content Detail Page */
.single-image {
    max-height: 80vh;
    width: auto;
    margin: 0 auto;
    display: block;
}

.carousel-image {
    max-height: 70vh;
    object-fit: contain;
    background: #000;
}

.video-container {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-container video {
    max-height: 70vh;
}

/* Info Sidebar */
.info-sidebar .card {
    border: 1px solid #333333;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background-color: #111111;
    color: #ffffff;
}

.info-sidebar .card-header {
    background: #1a1a1a;
    border-bottom: 1px solid #333333;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    color: #ffffff;
}

.info-sidebar .card-body {
    background-color: #111111;
    color: #ffffff;
}

/* Search */
#searchInput {
    border-right: none;
    background-color: #222222;
    border-color: #444444;
    color: #ffffff;
}

#searchInput:focus {
    background-color: #333333;
    border-color: #666666;
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1);
}

#searchInput::placeholder {
    color: #aaaaaa;
}

.btn-outline-light {
    border-left: none;
    background-color: #333333;
    border-color: #444444;
    color: #ffffff;
}

.btn-outline-light:hover {
    background-color: #555555;
    border-color: #666666;
    color: #ffffff;
}

/* Filter Section */
.filter-card {
    background-color: #111111;
    border: 1px solid #333333;
    border-radius: 12px;
    overflow: hidden;
}

.filter-header {
    background-color: #1a1a1a;
    border-bottom: 1px solid #333333;
    padding: 1rem 1.25rem;
    transition: background-color 0.2s ease;
}

.filter-header:hover {
    background-color: #222222;
}

.filter-header h5 {
    color: #ffffff;
    font-weight: 600;
}

.filter-chevron {
    transition: transform 0.3s ease;
    color: #ffffff;
}

#filterIcon {
    transition: all 0.2s ease;
}

#filterIcon.bi-filter-circle-fill {
    color: #4dabf7;
}

.filter-group {
    margin-bottom: 0;
}

.filter-group .form-label {
    color: #ffffff;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.filter-group .form-label i {
    margin-right: 0.25rem;
    color: #4dabf7;
}

/* Form Controls Dark Theme */
.form-control {
    background-color: #222222;
    border: 1px solid #444444;
    color: #ffffff;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.form-control:focus {
    background-color: #2a2a2a;
    border-color: #4dabf7;
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(77, 171, 247, 0.25);
}

.form-control::placeholder {
    color: #888888;
}

/* Date Input Specific */
input[type="date"].form-control {
    color-scheme: dark;
}

input[type="date"].form-control::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Filter Status */
#filterStatus {
    font-size: 0.9rem;
    font-weight: 500;
}

.text-info {
    color: #4dabf7 !important;
}

/* Empty State */
.empty-state {
    padding: 3rem 1rem;
}

.empty-state-logo {
    height: 64px;
    width: auto;
    filter: brightness(0.8) grayscale(0.3);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.empty-state-logo:hover {
    filter: brightness(1) grayscale(0);
    opacity: 0.8;
}

/* Loading Spinner */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Dark theme Bootstrap component overrides */
.alert {
    background-color: #1a1a1a;
    border-color: #333333;
    color: #ffffff;
}

.alert-warning {
    background-color: #2a1f0a;
    border-color: #664d03;
    color: #ffecb5;
}

.modal-content {
    background-color: #111111;
    border: 1px solid #333333;
    color: #ffffff;
}

.modal-header {
    border-bottom: 1px solid #333333;
}

.modal-footer {
    border-top: 1px solid #333333;
}

.lead {
    color: #cccccc;
}

.display-4, .display-5 {
    color: #ffffff;
}

/* Navbar dark theme enhancement */
.navbar-dark {
    background-color: #111111 !important;
    border-bottom: 1px solid #333333;
}


/* Detail Page Logo */
.detail-page-logo {
    height: 24px;
    width: auto;
    filter: brightness(1.1);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.detail-page-logo:hover {
    opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .display-4:not(.welcome-header) {
        font-size: 2rem;
    }
    
    .content-card .card-body {
        padding: 0.75rem;
    }
    
    .thumbnail-container {
        padding-bottom: 177.78%; /* Maintain 9:16 ratio on mobile */
    }
    
    .navbar-logo {
        height: 28px;
    }
    
    .navbar-title {
        font-size: 1.1rem;
    }
    
    .detail-page-logo {
        height: 20px;
    }
}

@media (max-width: 768px) {
    .single-image,
    .carousel-image {
        max-height: 50vh;
    }
    
    .video-container video {
        max-height: 50vh;
    }
}

/* Custom Bootstrap overrides */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    font-weight: 500;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: #ffffff;
}

.btn-outline-primary {
    color: #4dabf7;
    border-color: #4dabf7;
    font-weight: 500;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: #4dabf7;
    border-color: #4dabf7;
    color: #000000;
}

.btn-outline-secondary {
    color: #cccccc;
    border-color: #666666;
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: #666666;
    border-color: #666666;
    color: #ffffff;
}

.btn-sm {
    font-size: 0.8rem;
}

/* Card hover effects */
.list-group-item {
    border: none;
    padding: 0.5rem 0;
    background-color: transparent;
    color: #ffffff;
}

.list-group-item:not(:last-child) {
    border-bottom: 1px solid #333333;
}

/* Carousel customization */
.carousel-indicators {
    margin-bottom: 0;
}

.carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 3px;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
}

.carousel-indicators .active {
    background-color: #fff;
}

.carousel-control-prev,
.carousel-control-next {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.carousel-control-prev {
    left: 10px;
}

.carousel-control-next {
    right: 10px;
}

/* Text truncation */
.text-truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Badge styling */
.badge {
    font-weight: 500;
}

.bg-danger {
    background-color: #dc3545 !important;
}

.bg-info {
    background-color: #0dcaf0 !important;
}

.bg-secondary {
    background-color: #6c757d !important;
}

/* Animation for loading states */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading-placeholder {
    animation: pulse 1.5s ease-in-out infinite;
    background-color: #333333;
    border-radius: 4px;
}

/* Footer */
footer {
    margin-top: auto;
    background-color: #111111 !important;
    color: #ffffff;
    border-top: 1px solid #333333;
}

/* Scrollbar styling for webkit browsers - Dark Theme */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #111111;
}

::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666666;
}
