/**
 * D4 Build System - Frontend Styles
 */

/* Build Archive Grid */
.d4-builds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

/* Build Card */
.d4-build-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.d4-build-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.d4-build-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.d4-build-content {
    padding: 20px;
}

.d4-build-content h2,
.d4-build-content h3 {
    margin: 0 0 15px 0;
    color: #fff;
}

.d4-build-content h2 a,
.d4-build-content h3 a {
    color: #fff;
    text-decoration: none;
}

.d4-build-content h2 a:hover,
.d4-build-content h3 a:hover {
    color: #ff8800;
}

.d4-build-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 14px;
}

.d4-build-meta span {
    padding: 5px 10px;
    background: #2a2a2a;
    border-radius: 4px;
    color: #ccc;
}

.d4-build-difficulty {
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
}

.difficulty-beginner {
    background: #4caf50;
    color: #fff;
}

.difficulty-intermediate {
    background: #ff9800;
    color: #fff;
}

.difficulty-advanced {
    background: #f44336;
    color: #fff;
}

.d4-build-excerpt {
    color: #aaa;
    margin-bottom: 15px;
    line-height: 1.6;
}

.d4-build-link {
    display: inline-block;
    padding: 10px 20px;
    background: #ff8800;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.d4-build-link:hover {
    background: #cc6600;
}

/* Single Build */
.d4-build-single {
    max-width: 1200px;
    margin: 0 auto;
    background: #1a1a1a;
    padding: 30px;
    color: #fff;
}

.d4-build-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #333;
}

.d4-build-header h1 {
    margin: 0 0 15px 0;
    color: #ff8800;
}

.d4-build-section {
    margin: 40px 0;
    padding: 30px;
    background: #2a2a2a;
    border-radius: 8px;
}

.d4-build-section h2 {
    margin: 0 0 20px 0;
    color: #ff8800;
    border-bottom: 2px solid #ff8800;
    padding-bottom: 10px;
}

/* Equipment Grid */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.equipment-slot {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
}

.slot-label {
    font-weight: bold;
    color: #ff8800;
    margin-bottom: 10px;
}

.slot-item img {
    max-width: 64px;
    height: auto;
    margin: 10px 0;
}

.slot-item a {
    color: #fff;
    text-decoration: none;
}

.slot-item a:hover {
    color: #ff8800;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.skill-slot {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
}

.skill-slot .slot-label {
    font-weight: bold;
    color: #ff8800;
    margin-bottom: 10px;
}

.slot-skill img {
    max-width: 48px;
    height: auto;
    margin: 10px 0;
}

.slot-skill a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.slot-skill a:hover {
    color: #ff8800;
}

/* ===================================
   PARAGON TAB FRONTEND - INGAME STYLE
   (Like D4 Paragon Board Screen)
   =================================== */

.d4-paragon-ingame-section {
    padding: 20px 0;
    background: #0a0a0a;
    min-height: 400px;
}

/* Tab background colors */
.d4-tab-panel {
    background: #1E1F24;
}

.d4-paragon-section {
    padding: 0;
    margin: 0;
}

/* Paragon Info Bar Container */
#d4-paragon-info-bar-container {
    margin: 0;
    padding: 0;
}

/* Paragon Info Bar */
.d4-paragon-info-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 10px;
    background: #1E1F24;
}

#d4-paragon-canvas {
    display: block;
    margin: 0;
    padding: 0;
}

.d4-paragon-info-box {
    display: flex;
    gap: 16px;
    align-items: center;
    background: #1A1B20;
    border-radius: 4px;
    padding: 5px 16px;
    height: 40px;
    box-sizing: border-box;
}

.d4-paragon-info-points {
    display: flex;
    gap: 8px;
    align-items: center;
}

.d4-paragon-info-label {
    color: #D1A781;
    font-size: 14px;
}

.d4-paragon-info-value {
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
}

.d4-paragon-info-glyphs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.d4-paragon-info-glyph {
    width: 30px;
    height: 30px;
    cursor: pointer;
    position: relative;
}

.d4-paragon-info-glyph img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.d4-paragon-info-empty {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

.d4-paragon-boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 30px;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
}

.d4-paragon-board-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
}

.d4-board-title-bar {
    background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3a3a3a;
}

.d4-board-name {
    color: #f4c542;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.d4-board-glyph {
    color: #9b30ff;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    background: rgba(155, 48, 255, 0.15);
    border-radius: 3px;
    border: 1px solid rgba(155, 48, 255, 0.3);
}

.d4-board-canvas-wrapper {
    padding: 20px;
    background: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.d4-paragon-board-grid {
    border: none;
    box-shadow: none;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Canvas Overlay Nodes - Frontend (NO TOOLTIPS) */
.d4-board-canvas-wrapper .d4-paragon-node {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.d4-board-canvas-wrapper .d4-paragon-node.active {
    box-shadow: 0 0 0 4px #ff0000, 0 0 12px rgba(255, 0, 0, 0.6);
}

.d4-paragon-empty-state {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 80px 20px;
    text-align: center;
    margin: 20px;
}

.d4-paragon-empty-state p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Old Paragon List Styles (backwards compatibility) */
.paragon-boards ul,
.paragon-glyphs ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.paragon-boards li,
.paragon-glyphs li {
    padding: 10px;
    background: #26272d;
    border-left: 3px solid #ff8800;
    margin-bottom: 5px;
}

/* Media */
.build-video iframe {
    max-width: 100%;
    height: auto;
    aspect-ratio: 16/9;
}

/* Responsive */
@media (max-width: 768px) {
    .d4-builds-grid {
        grid-template-columns: 1fr;
    }

    .equipment-grid,
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Paragon Responsive - Ingame Style */
    .d4-paragon-boards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }

    .d4-board-title-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .d4-board-canvas-wrapper {
        padding: 10px;
        min-height: 300px;
    }
}

/* ===================================
   BUILD ARCHIVE TABLE VIEW
   (d4-database exact colors)
   =================================== */

:root {
    --bg-primary: #191919;
    --bg-card: #26272d;
    --bg-card-hover: #2a2b31;
    --bg-table-hover: #3a3b41;
    --text-white: #ffffff;
    --text-secondary: #a1a1aa;
    --text-placeholder: #A8A8AB;
    --border-primary: #444757;
    --accent-orange: #ff8800;
}

/* Archive Container */
.d4-builds-archive {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #191919;
    color: var(--text-white);
}

body {
    background: #191919 !important;
}

/* Search Section */
.d4-search-section {
    margin-bottom: 20px;
    position: relative;
}

.d4-search-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.d4-search-input-wide {
    flex: 1 !important;
    width: auto !important;
    background: #2a2b31 !important;
    border: none !important;
    border-radius: 3px !important;
    color: #A8A8AB !important;
    padding: 10px 20px 10px 45px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    height: 44px !important;
    box-sizing: border-box !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8A8AB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='8'/%3e%3cpath d='m21 21-4.35-4.35'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: 15px center !important;
    background-size: 20px 20px !important;
}

.d4-search-input-wide:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    background: #2a2b31 !important;
    color: #A8A8AB !important;
}

.d4-search-input-wide::placeholder {
    color: #A8A8AB !important;
    font-style: italic !important;
}

/* Reset Button */
.d4-reset-button {
    background: #2a2b31 !important;
    border: none !important;
    border-radius: 3px !important;
    color: #A8A8AB !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 20px !important;
    font-weight: 300 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.d4-reset-button:hover {
    background: #3a3b41 !important;
    color: #ef4444 !important;
}

.d4-reset-button:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Filters Section */
.d4-filters-section {
    margin-bottom: 30px;
}

.d4-filters-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: stretch;
}

/* Class Filter Buttons */
.d4-class-filters {
    display: flex;
    gap: 8px;
    flex: 1;
}

.d4-class-btn {
    background: #2a2b31;
    border: none;
    color: var(--text-white);
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.d4-class-btn:hover {
    background: #3a3b41;
}

.d4-class-btn.active {
    background: var(--accent-orange);
    color: var(--text-white);
}

/* ========================================
   SKILL TREE STYLES (Frontend)
   ======================================== */

/* Hub Nodes - Thick 5px border */
.skill-node.hub .node-border,
.skill-node.hub .hub-border {
    stroke-width: 5 !important;
    stroke: #D00C08;
}

/* Regular allocated nodes (not hubs) */
.skill-node.allocated:not(.hub) .node-border {
    stroke-width: 3;
    stroke: #d00c08;
}

/* Unallocated nodes (not hubs) */
.skill-node.unallocated:not(.hub) .node-border {
    stroke-width: 2;
    stroke: #999;
    opacity: 0.5;
}

/* Dropdown Filters */
.d4-dropdown-filters {
    display: flex;
    gap: 8px;
}

.d4-filter-select {
    background: #2a2b31;
    border: none;
    border-radius: 3px;
    color: var(--text-white);
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 140px;
    height: 44px;
    box-sizing: border-box;
    text-align: center;
    text-align-last: center;
}

.d4-filter-select:hover {
    background: #3a3b41;
}

.d4-filter-select:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.d4-filter-select option {
    background: #2a2b31;
    color: var(--text-white);
}

/* Table Container */
.d4-table-container {
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 20px;
}

/* Builds Table */
.d4-builds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: none;
    table-layout: auto;
}

.d4-builds-table thead {
    background: #1F2025 !important;
    border: none !important;
}

.d4-builds-table thead th {
    padding: 10px 12px;
    text-align: left;
    color: var(--text-white);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none !important;
    border-bottom: none !important;
    white-space: nowrap;
    background: #1F2025 !important;
}

.d4-builds-table tbody tr {
    background: #333333;
    border-bottom: 1px solid var(--border-primary);
    border-left: none !important;
    transition: background 0.2s;
    cursor: pointer;
}

.d4-builds-table tbody tr:hover {
    background: #2a2a2a;
    border-left: none !important;
}

.d4-builds-table tbody td {
    padding: 12px;
    color: var(--text-white);
    border: none;
    vertical-align: middle;
    white-space: nowrap;
}

/* Column Widths - flexible */
.d4-col-name {
    width: auto;
    min-width: 200px;
}

.d4-col-class {
    width: auto;
}

.d4-col-type {
    width: auto;
}

.d4-col-tier {
    width: auto;
}

.d4-col-season {
    width: auto;
}

.d4-col-updated {
    width: auto;
}

/* Build Name with Icon */
.d4-build-name-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.d4-build-class-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 3px;
    margin: 0;
}

.d4-build-name-text {
    color: var(--text-white);
    font-weight: 600;
    font-size: 15px;
    margin: 0;
    text-align: left;
}

/* Build Link - ganze Zeile */
.d4-builds-table tbody tr {
    text-decoration: none;
}

/* Erste Spalte (Name) - Icon ganz links */
.d4-col-name {
    padding-left: 12px !important;
    text-align: left !important;
}

/* Tier Badges */
.tier-badge {
    display: inline-block;
    padding: 10px 10px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-align: center;
    min-width: 40px;
    color: #fff;
    vertical-align: middle;
    margin: 0;
    line-height: 1;
}

.tier-s {
    background: #FF7F7F;
}

.tier-a {
    background: #FFBF7F;
}

.tier-b {
    background: #FFDF7F;
}

.tier-c {
    background: #AED581;
}

/* Build Type Badges */
.d4-col-type {
    white-space: nowrap !important;
    min-width: 200px;
}

.build-type-badge {
    display: inline-block;
    padding: 10px 10px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 13px;
    background: #2a2b31;
    color: #fff;
    margin: 0 4px 0 0;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1;
}

.build-type-badge:last-child {
    margin-right: 0;
}

/* No Builds Message */
.d4-no-builds {
    text-align: center;
    padding: 40px 20px !important;
    color: var(--text-secondary);
    font-size: 15px;
}

/* Pagination */
.d4-pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.d4-pagination .nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.d4-pagination .page-numbers {
    background: var(--bg-card);
    color: var(--text-white);
    padding: 8px 14px;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    transition: all 0.2s;
}

.d4-pagination .page-numbers:hover,
.d4-pagination .page-numbers.current {
    background: var(--accent-orange);
    color: var(--text-white);
}

.d4-pagination .dots {
    color: var(--text-secondary);
    padding: 0 8px;
}

/* Loading Indicator */
.d4-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.d4-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-card);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Table */
@media (max-width: 1024px) {
    .d4-filters-row {
        flex-wrap: wrap;
    }

    .d4-class-btn {
        flex: 1 1 auto;
        min-width: 100px;
    }

    .d4-filter-select {
        flex: 1 1 140px;
    }
}

@media (max-width: 1200px) {
    .d4-builds-table tbody td {
        white-space: normal;
    }
}

@media (max-width: 768px) {
    .d4-filters-row {
        gap: 8px;
    }

    .d4-class-btn {
        font-size: 12px;
        padding: 8px 12px;
        min-width: 80px;
    }

    .d4-filter-select {
        font-size: 13px;
        min-width: 110px;
        max-width: 130px;
    }

    .d4-builds-table {
        font-size: 12px;
    }

    .d4-builds-table thead th,
    .d4-builds-table tbody td {
        padding: 8px 6px;
    }

    .d4-col-name {
        min-width: 150px;
    }

    .d4-build-class-icon {
        width: 24px;
        height: 24px;
    }

    .d4-build-name-text {
        font-size: 13px;
    }

    .tier-badge {
        font-size: 10px;
        padding: 3px 8px;
        min-width: 30px;
    }
}

/* Spirit Boon Icons - Disable hover effects */
.d4-spirit-boon-icon.d4-no-hover {
    transition: none !important;
    transform: none !important;
}

.d4-spirit-boon-icon.d4-no-hover:hover {
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
    box-shadow: none !important;
}
