/* ============================================
   Purple Theme Customization for Bulma
   ============================================ */

:root {
    --bulma-primary-h: 258deg;
    --bulma-primary-s: 77%;
    --bulma-primary-l: 58%;
    --bulma-primary: hsl(258, 77%, 58%);
    --bulma-primary-invert: #fff;
}

/* ============================================
   Global Styles
   ============================================ */

body {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* ============================================
   Development Badge
   ============================================ */

.dev-badge {
    position: fixed;
    top: 50px;
    left: -70px;
    background: #f97316;
    color: #000;
    padding: 10px 100px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    transform: rotate(-45deg);
    z-index: 1001;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: help;
    user-select: none;
}

.dev-badge::after {
    content: attr(title);
    position: fixed;
    top: 120px;
    left: 20px;
    transform: rotate(45deg);
    background: #111827;
    color: #f9fafb;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: normal;
    width: 280px;
    text-align: left;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
}

.dev-badge:hover::after {
    opacity: 1;
}

/* ============================================
   Hero/Header Customization
   ============================================ */

.hero.is-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.hero .hero-body {
    padding: 1.5rem 1.5rem;
}

.hero .title {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.hero .title a {
    text-decoration: none;
}

.hero .title a:hover {
    opacity: 0.85;
}

.hero .button.is-primary.is-inverted.is-outlined {
    background-color: transparent;
    border-color: white;
    color: white;
}

.hero .button.is-primary.is-inverted.is-outlined:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.hero .button svg path {
    fill: white;
}

/* ============================================
   Legend Toggle Bar
   ============================================ */

.legend-toggle {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.legend-toggle:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.legend-toggle-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    color: white;
    font-weight: 600;
}

.legend-toggle-icon {
    font-size: 0.75rem;
}

.legend-toggle-text {
    font-size: 0.95rem;
}

/* ============================================
   Legend Box
   ============================================ */

.legend-box {
    margin: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #e5e7eb;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-item span:not(.tag) {
    font-size: 0.9rem;
    color: #6b7280;
}

.status-emoji {
    font-size: 1.2rem;
}

/* Shared Badge Colors */
.legend-badge.GA,
.status-badge.GA {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.legend-badge.PRE,
.status-badge.PRE {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}

.legend-badge.PRV,
.status-badge.PRV {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

.legend-badge.DEP,
.status-badge.DEP {
    background-color: #fee2e2 !important;
    color: #ef4444 !important;
}

/* ============================================
   Main Content Section
   ============================================ */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

/* ============================================
   Tags/Filter Bar
   ============================================ */

.tags-bar {
    margin-bottom: 1.5rem;
}

.tags-bar .field.has-addons {
    margin-bottom: 0;
}

.tags-bar .tags {
    margin-top: 0 !important;
    margin-bottom: 0.5rem;
}

.tag.is-clickable {
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    padding: 0 0.5rem;
}

.tag.is-clickable:not(.is-primary) {
    background-color: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #e9d5ff;
}

.tag.is-clickable:not(.is-primary):hover {
    background-color: #e9d5ff;
}

.tag-count {
    margin-left: 6px;
    padding: 2px 5px;
    background: rgba(124, 58, 237, 0.15);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tag.is-primary .tag-count {
    background: rgba(255, 255, 255, 0.3);
}

.deprecated-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 1rem;
    height: 1.75rem;
    background: #f3e8ff;
    color: #7c3aed;
    border-radius: 4px;
    border: 1px solid #e9d5ff;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.deprecated-toggle:hover {
    background: #e9d5ff;
}

/* ============================================
   Table Customization
   ============================================ */

.table-container {
    flex: 1;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-height: calc(100vh - 320px);
    transition: max-height 0.3s ease;
}

.legend-expanded .table-container {
    max-height: calc(100vh - 520px);
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    position: sticky;
    top: 0;
}

.table thead th {
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

.ide-header {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ide-logo {
    width: 32px;
    height: 32px;
    display: block;
    cursor: help;
}

.feature-name {
    cursor: help;
    position: relative;
}

.checkmark {
    margin-right: 5px;
}

/* Status Badge Colors */
.status-badge {
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
}

.status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.status-emoji-link {
    font-size: 1.2rem;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s;
}

.status-emoji-link:hover {
    transform: scale(1.2);
}

.flag-icon {
    margin-left: 5px;
}

/* ============================================
   Tooltip
   ============================================ */

.feature-tooltip {
    position: fixed;
    max-width: 320px;
    background: #111827;
    color: #f9fafb;
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.4);
    font-size: 0.8rem;
    line-height: 1.4;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease-out;
}

.feature-tooltip.visible {
    opacity: 1;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .app-container {
        min-height: calc(100vh - 20px);
    }

    .hero .level,
    .hero .level-left,
    .hero .level-right {
        display: block;
    }

    .hero .level-item {
        margin-bottom: 0.75rem;
    }

    .hero .title {
        font-size: 1.5rem;
    }

    .legend-grid {
        grid-template-columns: 1fr;
    }

    .search-container {
        flex-wrap: wrap;
    }

    .dev-badge {
        top: 40px;
        left: -60px;
        padding: 8px 50px;
        font-size: 0.75rem;
    }

    .dev-badge::after {
        top: 100px;
        left: 10px;
        width: 220px;
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .hero .title {
        font-size: 1.25rem;
    }
}
