/* TSW Tips Stylesheet */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    padding: 20px;
    color: #d4d4d4;
}

/* Table of Contents */
.toc-container {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 50px;
    background: #1a1d2e;
    border: 2px solid #CD853F;
    border-radius: 8px;
    z-index: 900;
    transition: width 0.3s ease, height 0.3s ease;
    max-height: 60px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.toc-container:not(.collapsed) {
    width: 280px;
    max-height: calc(100vh - 40px);
}

.toc-toggle {
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    border-radius: 6px 6px 6px 6px;
    color: #f5f5f5;
    user-select: none;
    white-space: nowrap;
    order: 2;
}

.toc-container:not(.collapsed) .toc-toggle {
    border-radius: 0 0 6px 6px;
}

.toc-toggle:hover {
    background: linear-gradient(135deg, #D2691E 0%, #CD853F 100%);
}

.toc-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.toc-title {
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toc-container:not(.collapsed) .toc-title {
    opacity: 1;
}

.toc-content {
    max-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.3s ease;
    order: 1;
}

.toc-container:not(.collapsed) .toc-content {
    max-height: calc(100vh - 100px);
    padding: 10px 0;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list li {
    margin: 0;
    padding: 0;
}

.toc-list a {
    display: block;
    padding: 8px 15px;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.toc-list a:hover {
    background: #2a2d3a;
    border-left-color: #D2691E;
    color: #fff;
}

.toc-list a:active {
    background: #3a3d4a;
}

/* Scrollbar styling for TOC */
.toc-content::-webkit-scrollbar {
    width: 6px;
}

.toc-content::-webkit-scrollbar-track {
    background: #1a1d2e;
}

.toc-content::-webkit-scrollbar-thumb {
    background: #4a4d5a;
    border-radius: 3px;
}

.toc-content::-webkit-scrollbar-thumb:hover {
    background: #CD853F;
}

/* Site Header */
.site-header {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    padding: 10px 20px;
    margin: 0;
    border-bottom: 2px solid #CD853F;
}

.site-title {
    color: #f5f5f5;
    font-size: 1.5em;
    margin: 0 0 8px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.site-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-dropdown {
    position: relative;
    padding-bottom: 5px;
}

.nav-dropdown-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #f5f5f5;
    padding: 6px 12px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-dropdown-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% - 5px);
    background: #0f1419;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    border: 2px solid #CD853F;
    border-radius: 6px;
    overflow: hidden;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.nav-dropdown-content a {
    display: block;
    padding: 12px 16px;
    color: #c0c0c0;
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 1px solid #2a2d3a;
}

.nav-dropdown-content a:last-child {
    border-bottom: none;
}

.nav-dropdown-content a:hover {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: #f5f5f5;
    padding-left: 24px;
}

.nav-dropdown-content a.active {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #0f1419;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    border: 1px solid #2a2d3a;
}

.content {
    padding: 40px;
    background: #1a1d2e;
}

h2 {
    color: #D2691E;
    margin-bottom: 30px;
    font-size: 2em;
    border-bottom: 2px solid #CD853F;
    padding-bottom: 10px;
}

h3 {
    color: #CD853F;
    margin: 25px 0 15px 0;
    font-size: 1.5em;
}

h4 {
    color: #CD853F;
    margin: 20px 0 10px 0;
    font-size: 1.2em;
}

p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #c0c0c0;
}

a {
    color: #D2691E;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #CD853F;
}

/* Info Box */
.info-box {
    background: #0f1419;
    border: 2px solid #CD853F;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.info-box p {
    margin-bottom: 10px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* Collapsible Sections */
.collapsible-section {
    margin-bottom: 12px;
    scroll-margin-top: 80px;
}

.collapsible-section:target,
.collapsible-section.anchor-highlight {
    animation: highlight-pulse 2s ease-out;
}

.section-header {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: #f5f5f5;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    user-select: none;
    border: 2px solid #CD853F;
    border-bottom: none;
    position: relative;
    z-index: 1;
}

.section-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header:hover {
    background: linear-gradient(135deg, #D2691E 0%, #CD853F 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(210, 105, 30, 0.4);
}

.section-header:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(210, 105, 30, 0.3);
}

.section-header h3 {
    margin: 0;
    color: #f5f5f5;
}

.collapse-icon {
    font-size: 1.2em;
    transition: transform 0.3s;
}

.collapse-icon.collapsed {
    transform: rotate(-90deg);
}

.section-content {
    max-height: 5000px;
    overflow: visible;
    transition: max-height 0.2s ease-out;
    background: #0f1419;
    border: 2px solid #CD853F;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    position: relative;
}

.section-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    width: 2px;
    height: 0;
    background: #CD853F;
    transition: height 0.3s;
}

.section-content::after {
    content: '';
    position: absolute;
    top: 0;
    right: -2px;
    width: 2px;
    height: 0;
    background: #CD853F;
    transition: height 0.3s;
}

.collapsible-section:hover .section-content::before,
.collapsible-section:hover .section-content::after {
    height: 2px;
}

.section-content.collapsed {
    max-height: 0;
    padding: 0 20px;
    border: none;
    overflow: hidden;
}

.section-description {
    margin-bottom: 20px;
    color: #c0c0c0;
    line-height: 1.6;
}

.section-description p {
    margin: 0 0 10px 0;
}

.section-description p:last-child {
    margin-bottom: 0;
}

/* Grid layouts with dynamic column counts */
.grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding-top: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-top: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding-top: 20px;
}

/* Legacy class for backwards compatibility */
.mod-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding-top: 20px;
}

/* Item Cards */
.item-card {
    background: #0f1419;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
    scroll-margin-top: 20px;
    position: relative;
}

.item-card:hover {
    border-color: #CD853F;
    box-shadow: 0 4px 12px rgba(210, 105, 30, 0.2);
}

.item-card:target,
.item-card.anchor-highlight {
    border-color: #D2691E;
    box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.3);
    animation: highlight-pulse 2s ease-out;
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.6);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.3);
    }
}

.item-card h4 {
    margin-top: 0;
    padding-right: 40px;
}

/* Title with Copy Link */
.title-with-link {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.title-with-link h4 {
    margin: 0;
}

/* Copy Link Button */
.copy-link-button {
    background: rgba(210, 105, 30, 0.2);
    border: 1px solid rgba(210, 105, 30, 0.4);
    color: #D2691E;
    padding: 6px 10px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.copy-link-button:hover {
    background: rgba(210, 105, 30, 0.3);
    border-color: #D2691E;
    transform: scale(1.1);
}

.copy-link-button.card-copy {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.copy-link-button.section-copy {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #f5f5f5;
}

.copy-link-button.section-copy:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Download Links */
.download-link {
    display: inline-block;
    margin-top: 10px;
    margin-right: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: #f5f5f5;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.download-link:hover {
    background: linear-gradient(135deg, #D2691E 0%, #CD853F 100%);
    box-shadow: 0 6px 16px rgba(210, 105, 30, 0.5);
    color: #f5f5f5;
    transform: translateY(-3px);
}

.download-link:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(210, 105, 30, 0.4);
}

/* Link List */
.link-list {
    margin-top: 20px;
}

.link-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2a2d3a;
    position: relative;
}

.link-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.link-item h5 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    padding-right: 40px;
}

.link-item h5 a {
    color: #D2691E;
    text-decoration: none;
    transition: color 0.3s;
}

.link-item h5 a:hover {
    color: #CD853F;
}

.link-description {
    color: #c0c0c0;
    line-height: 1.6;
}

.link-description p {
    margin: 0;
}

.copy-link-button.link-copy {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
}

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

/* Item Links and Tooltips */
.item-link {
    text-decoration: none;
    cursor: help;
    position: relative;
    display: inline-block;
    font-weight: bold;
}

.item-link.common {
    color: #ffffff;
}

.item-link.uncommon {
    color: #1eff00;
}

.item-link.rare {
    color: #0070dd;
}

.item-link.epic {
    color: #a335ee;
}

.item-link.heroic {
    color: #ffaa00;
}

.item-link-error {
    color: #ff0000;
    font-style: italic;
}

.item-tooltip-container {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    z-index: 1000;
    pointer-events: none;
}

.item-link:hover .item-tooltip-container {
    display: block;
}

/* Inline display tooltips */
.item-tooltip-inline {
    display: block;
    position: static;
    transform: none;
    margin: 10px 0;
    pointer-events: auto;
}

.item-tooltip {
    background: #1a1a1a;
    border: 2px solid #4a4a4a;
    border-radius: 8px;
    min-width: 250px;
    max-width: 350px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.8);
    font-size: 13px;
    white-space: normal;
}

.item-tooltip-header {
    padding: 8px 12px;
    border-bottom: 1px solid #aaa;
    border-radius: 6px 6px 0 0;
    background: #1a1a1a;
}

.item-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 1px;
}

.item-name.common {
    color: #ffffff;
}

.item-name.uncommon {
    color: #1eff00;
}

.item-name.rare {
    color: #0070dd;
}

.item-name.epic {
    color: #a335ee;
}

.item-name.heroic {
    color: #ffaa00;
}

.item-meta {
    font-size: 11px;
    color: #ccc;
    margin-bottom: 4px;
}

.item-bound-unique {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
}

.item-tooltip-body {
    padding: 8px 12px;
    color: #e0e0e0;
}

.item-description {
    margin-bottom: 8px;
    line-height: 1.4;
    font-weight: normal;
}

.item-cooldown-info {
    margin-top: 8px;
}

.item-cooldown-info p {
    margin: 0;
    line-height: 1.4;
}

.cooldown-type {
    color: #ffaa00;
}

.item-number {
    color: #ff8800;
}

/* Legacy styles for backwards compatibility */
.item-cooldown,
.item-bound,
.item-unique {
    font-size: 11px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #4a4a4a;
}

.item-bound,
.item-unique {
    color: #ff6b6b;
}

/* Responsive Design */

@media (max-width: 1200px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 968px) {
    .mod-grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    h2 {
        font-size: 1.5em;
    }
    
    body {
        padding: 10px;
    }
}
