/* Custom styles for SuperStream4 Config Builder */

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #1a1a2e;
}
::-webkit-scrollbar-thumb {
    background: #4a4a6a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

/* Copy button for code blocks */
.copy-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
    font-family: inherit;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 1;
}
.copy-btn:hover {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(99, 102, 241, 0.5);
}
.copy-btn.copied {
    color: #86efac;
    border-color: rgba(134, 239, 172, 0.4);
}

/* YAML code block */
.yaml-preview {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    tab-size: 2;
    white-space: pre;
    color: #e2e8f0;
}

.yaml-preview .yaml-key { color: #7dd3fc; }
.yaml-preview .yaml-string { color: #86efac; }
.yaml-preview .yaml-number { color: #fbbf24; }
.yaml-preview .yaml-boolean { color: #c084fc; }
.yaml-preview .yaml-comment { color: #64748b; font-style: italic; }

/* Smooth transitions */
.sidebar-item {
    transition: all 0.15s ease;
}
.sidebar-item:hover {
    background: rgba(99, 102, 241, 0.15);
}
.sidebar-item.active {
    background: rgba(99, 102, 241, 0.25);
    border-left: 3px solid #6366f1;
}

/* Action cards */
.action-card {
    transition: all 0.2s ease;
    border: 1px solid rgba(99, 102, 241, 0.2);
}
.action-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

/* Category badges */
.category-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Pulse animation for save indicator */
@keyframes pulse-save {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.saving {
    animation: pulse-save 1s ease-in-out infinite;
}

/* Modal backdrop */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Input focus styles */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.admin-form-shell,
.admin-form-shell * {
    min-width: 0;
}

.admin-form-control {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.admin-form-shell select.admin-form-control {
    overflow: hidden;
    text-overflow: ellipsis;
}

.wiki-shell {
    background-image:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 24rem),
        linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.92));
}

.portal-hero {
    background-image:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.18), transparent 24rem),
        radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.14), transparent 26rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.96));
}

.wiki-content {
    color: #d7e1f0;
    line-height: 1.8;
    font-size: 1rem;
}

.wiki-content h1,
.wiki-content h2,
.wiki-content h3,
.wiki-content h4 {
    color: #f8fafc;
    font-weight: 700;
    line-height: 1.2;
}

.wiki-content h2,
.wiki-content h3 {
    margin-top: 2.5rem;
}

.wiki-content p,
.wiki-content ul,
.wiki-content ol,
.wiki-content pre,
.wiki-content table,
.wiki-content blockquote {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.wiki-content a {
    color: #7dd3fc;
    text-decoration: none;
}

.wiki-content a:hover {
    color: #bae6fd;
    text-decoration: underline;
}

.wiki-content ul,
.wiki-content ol {
    padding-left: 1.5rem;
}

.wiki-content li + li {
    margin-top: 0.4rem;
}

.wiki-content blockquote {
    border-left: 3px solid rgba(56, 189, 248, 0.6);
    padding-left: 1rem;
    color: #94a3b8;
}

.wiki-content code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.9em;
    padding: 0.15rem 0.35rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 0.5rem;
}

.wiki-content pre {
    overflow-x: auto;
    border-radius: 1.25rem;
    border: 1px solid rgba(51, 65, 85, 0.8);
    background: #0b1120;
}

.wiki-content pre code {
    display: block;
    padding: 1.2rem 1.3rem;
    background: transparent;
    border: none;
    border-radius: 0;
}

.wiki-content table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid rgba(51, 65, 85, 0.8);
}

.listing-inline-image {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 1.5rem;
    border: 1px solid rgba(51, 65, 85, 0.8);
    margin: 1.25rem 0;
}

.listing-video-wrap {
    margin: 1.25rem 0;
}

.listing-video {
    width: 100%;
    border-radius: 1.5rem;
    border: 1px solid rgba(51, 65, 85, 0.8);
    background: #020617;
}

.upload-progress-track {
    position: relative;
    width: 100%;
    height: 0.9rem;
    overflow: hidden;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(51, 65, 85, 0.8);
}

.upload-progress-bar {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #f97316, #fb7185, #22d3ee);
    transition: width 0.18s ease;
}

.wiki-content th,
.wiki-content td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.9);
    text-align: left;
    vertical-align: top;
}

.wiki-content th {
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Tooltip */
[x-tooltip]::after {
    content: attr(x-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #1e1b4b;
    color: #e2e8f0;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
[x-tooltip]:hover::after {
    opacity: 1;
}

/* Discord button */
.discord-btn {
    background: #5865F2;
    transition: background 0.2s;
}
.discord-btn:hover {
    background: #4752C4;
}

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Gift picker */
.gift-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0.75rem;
}

.gift-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-height: 9.5rem;
    padding: 0.75rem 0.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(71, 85, 105, 0.7);
    background: linear-gradient(180deg, rgba(31, 41, 55, 0.9), rgba(17, 24, 39, 0.95));
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.gift-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.8);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.35);
}

.gift-tile-selected {
    border-color: rgba(16, 185, 129, 0.95);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.75), 0 14px 26px rgba(6, 95, 70, 0.22);
}

.gift-tile-selected-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.12rem 0.45rem;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.55);
    color: #6ee7b7;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gift-tile-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    padding: 0.35rem;
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(71, 85, 105, 0.7);
}

.gift-tile-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gift-tile-name {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.1;
    color: #f8fafc;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gift-tile-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.65rem;
    color: #94a3b8;
}

.gift-tile-id {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    color: #818cf8;
}

.gift-empty-state {
    padding: 3rem 1rem;
    border: 1px dashed rgba(71, 85, 105, 0.8);
    border-radius: 1rem;
    text-align: center;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.35);
}

.gift-recent-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.gift-recent-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(71, 85, 105, 0.7);
    background: rgba(17, 24, 39, 0.85);
    text-align: left;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.gift-recent-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.75);
    background: rgba(30, 41, 59, 0.92);
}

.gift-recent-chip-selected {
    border-color: rgba(16, 185, 129, 0.95);
    background: rgba(6, 78, 59, 0.18);
}

.gift-recent-image {
    width: 2.75rem;
    height: 2.75rem;
    object-fit: contain;
    border-radius: 0.85rem;
    padding: 0.25rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(71, 85, 105, 0.6);
}

.gift-recent-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.gift-recent-name {
    color: #f8fafc;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gift-recent-id {
    color: #818cf8;
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

@media (max-width: 1400px) {
    .gift-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .gift-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .gift-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .gift-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Global square theme override */
*,
*::before,
*::after {
    border-radius: 0 !important;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb {
    border-radius: 0 !important;
}
