/* ===== COLOR PALETTE ===== */
:root {
    --black: #0a0a0a;
    --dark-gray: #1a1a1a;
    --medium-gray: #2d2d2d;
    --light-gray: #f5f5f5;
    --white: #ffffff;
    --orange: #f97316;
    --orange-dark: #ea580c;
    --orange-light: #fb923c;
    --orange-glow: rgba(249, 115, 22, 0.3);
}

/* ===== GLOBAL ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--black);
    color: var(--light-gray);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* ===== HEADER / NAVBAR ===== */
.navbar {
    background: var(--dark-gray) !important;
    border-bottom: 2px solid var(--orange);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--white) !important;
    letter-spacing: -0.5px;
}

.navbar-brand span {
    color: var(--orange);
}

.nav-link {
    color: var(--light-gray) !important;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--orange) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--orange);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
    padding: 80px 0;
    border-bottom: 1px solid var(--medium-gray);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--orange-glow) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.3;
    pointer-events: none;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--white);
    line-height: 1.1;
}

.hero h1 span {
    color: var(--orange);
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: #aaa;
    max-width: 600px;
}

/* ===== SEARCH BAR ===== */
.search-box {
    background: var(--medium-gray);
    border-radius: 12px;
    padding: 6px 6px 6px 20px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
    max-width: 600px;
}

.search-box:focus-within {
    border-color: var(--orange);
    box-shadow: 0 0 20px var(--orange-glow);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--white);
    padding: 12px 0;
    flex: 1;
    outline: none;
    font-size: 1rem;
}

.search-box input::placeholder {
    color: #888;
}

.search-box button {
    background: var(--orange);
    border: none;
    color: var(--white);
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-box button:hover {
    background: var(--orange-dark);
    transform: scale(1.02);
}

/* ===== CASE CARDS ===== */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    padding: 40px 0;
}

.case-card {
    background: var(--dark-gray);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--medium-gray);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--orange), var(--orange-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.case-card:hover::before {
    transform: scaleX(1);
}

.case-card:hover {
    transform: translateY(-8px);
    border-color: var(--orange);
    box-shadow: 0 20px 60px rgba(249, 115, 22, 0.15);
}

.case-card .badge-brand {
    background: var(--orange);
    color: var(--black);
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.case-card h3 {
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 12px 0 8px;
}

.case-card .symptom {
    color: #aaa;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.case-card .solution-preview {
    background: var(--black);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.9rem;
    border-left: 3px solid var(--orange);
}

.case-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--medium-gray);
    font-size: 0.85rem;
    color: #777;
}

.case-card .upvote-btn {
    background: transparent;
    border: 1px solid var(--medium-gray);
    color: #aaa;
    padding: 4px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.case-card .upvote-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: var(--orange-glow);
}

/* ===== CASE DETAILS PAGE ===== */
.case-detail {
    padding: 40px 0;
}

.case-detail .header {
    margin-bottom: 32px;
}

.case-detail h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
}

.case-detail .device-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.case-detail .device-meta span {
    background: var(--medium-gray);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.case-detail .section {
    background: var(--dark-gray);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--medium-gray);
}

.case-detail .section h2 {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.case-detail .section h2 .step-number {
    background: var(--orange);
    color: var(--black);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
}

.case-detail .troubleshoot-step {
    padding: 12px 16px;
    background: var(--black);
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid var(--medium-gray);
    transition: border-color 0.3s ease;
}

.case-detail .troubleshoot-step:hover {
    border-left-color: var(--orange);
}

.case-detail .solution-box {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(249, 115, 22, 0.05));
    border: 2px solid var(--orange);
    border-radius: 12px;
    padding: 24px;
    position: relative;
}

.case-detail .solution-box::before {
    content: '✅ FINAL SOLUTION';
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--black);
    padding: 0 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--orange);
    letter-spacing: 1px;
}

/* ===== VIDEO EMBED ===== */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--black);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== FORUM / COMMENTS ===== */
.comment-section {
    margin-top: 40px;
}

.comment {
    background: var(--dark-gray);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--medium-gray);
}

.comment .author {
    color: var(--orange);
    font-weight: 700;
}

.comment .time {
    color: #666;
    font-size: 0.8rem;
}

.comment .alternative-solution {
    background: var(--black);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 8px;
    border-left: 3px solid var(--orange-light);
}

/* ===== ADMIN DASHBOARD ===== */
.admin-panel {
    background: var(--dark-gray);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--medium-gray);
}

.admin-panel .table {
    color: var(--light-gray);
}

.admin-panel .table thead {
    background: var(--black);
}

.admin-panel .table th {
    color: var(--orange);
    font-weight: 700;
    border-bottom: 2px solid var(--orange);
}

.admin-panel .table td {
    border-color: var(--medium-gray);
    vertical-align: middle;
}

.btn-orange {
    background: var(--orange);
    color: var(--black);
    font-weight: 700;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-orange:hover {
    background: var(--orange-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--orange-glow);
}

.btn-outline-orange {
    background: transparent;
    color: var(--orange);
    border: 2px solid var(--orange);
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-outline-orange:hover {
    background: var(--orange);
    color: var(--black);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .case-grid {
        grid-template-columns: 1fr;
    }
    
    .case-detail h1 {
        font-size: 1.8rem;
    }
    
    .search-box {
        flex-direction: column;
        padding: 12px;
        background: var(--medium-gray);
    }
    
    .search-box input {
        width: 100%;
        padding: 10px;
    }
    
    .search-box button {
        width: 100%;
        justify-content: center;
    }
}

/* ===== UTILITY ===== */
.text-orange { color: var(--orange); }
.bg-orange { background: var(--orange); }
.border-orange { border-color: var(--orange); }

.glow-hover:hover {
    box-shadow: 0 0 30px var(--orange-glow);
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== CASE CARD IMAGES ===== */
.case-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    margin: -24px -24px 16px -24px;
    background: var(--black);
    position: relative;
}

.case-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.case-card:hover .case-thumbnail img {
    transform: scale(1.03);
}

/* ===== CASE DETAIL IMAGES ===== */
.case-detail .section img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background: var(--black);
    border-radius: 12px;
}

/* ===== VIDEO WRAPPER ===== */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--black);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== RESPONSIVE IMAGES ===== */
@media (max-width: 768px) {
    .case-thumbnail {
        height: 160px;
    }
    
    .case-detail .section img {
        max-height: 300px;
    }
}
/* ===== CASE CARD MEDIA ===== */
.case-media {
    width: 100%;
    height: 220px;
    background: var(--black);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.case-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.case-card:hover .case-media img {
    transform: scale(1.05);
}

.case-media .media-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
}

.case-media .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.case-card:hover .case-media .play-overlay {
    background: var(--orange);
    border-color: var(--orange);
    transform: translate(-50%, -50%) scale(1.1);
}

.case-media .play-overlay i {
    color: white;
    font-size: 24px;
    margin-left: 4px;
}

.case-media .media-type {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0,0,0,0.8);
    color: #aaa;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.65rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.05);
}

.case-media .no-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #444;
    background: var(--dark-gray);
}

.case-media .no-media i {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.3;
}

.case-media .no-media span {
    font-size: 0.8rem;
    opacity: 0.5;
}

/* ===== MEDIA GALLERY ===== */
.media-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.media-gallery .media-item {
    background: var(--dark-gray);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--medium-gray);
    position: relative;
}

.media-gallery .media-item.full-width {
    grid-column: 1 / -1;
}

.media-gallery .media-item img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background: var(--black);
    display: block;
}

.media-gallery .media-item .media-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== VIDEO EMBEDS ===== */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: var(--black);
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== TIKTOK EMBED ===== */
.tiktok-embed-wrapper {
    background: var(--black);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    min-height: 400px;
    align-items: center;
    position: relative;
}

.tiktok-embed-wrapper blockquote {
    width: 100%;
    max-width: 605px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .media-gallery {
        grid-template-columns: 1fr;
    }
    
    .media-gallery .media-item img {
        max-height: 300px;
    }
    
    .case-media {
        height: 180px;
    }
}