/* SpawnCrate - Mod Page Styles */

/* Mod Header */
.mod-header {
    background: #16213e;
    padding: 20px;
    border-bottom: 1px solid #2a2a4a;
}

.mod-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.breadcrumbs {
    font-size: 0.85rem;
    color: #556677;
}

.breadcrumb-link {
    color: #00d4ff;
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    margin: 0 6px;
    color: #556677;
}

.breadcrumb-current {
    color: #8899a6;
}

.back-link {
    color: #00d4ff;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

.mod-title {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mod-title-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.mod-title-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.mod-title-text {
    display: flex;
    flex-direction: column;
}

.mod-title-name {
    color: #fff;
    font-size: 1.6rem;
    text-decoration: none;
}

a.mod-title-name.mod-title-link {
    text-decoration: none;
    color: #fff;
    transition: text-shadow 0.3s;
}

a.mod-title-name.mod-title-link:hover {
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.6), 0 0 20px rgba(0, 212, 255, 0.3);
    color: #00d4ff;
}

.mod-title-creator {
    font-size: 0.85rem;
    font-weight: 400;
    color: #00d4ff;
}

.mod-title-project-id {
    font-size: 0.8rem;
    font-weight: 400;
    color: #556677;
    text-decoration: none;
}

.mod-title-project-id:hover {
    color: #00d4ff;
}

.mod-title-updated {
    font-size: 0.8rem;
    font-weight: 400;
    color: #8899a6;
}

/* Search */
.search-bar {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    background: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    color: #fff;
    margin-bottom: 20px;
}

.search-bar:focus {
    outline: none;
    border-color: #00d4ff;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 25px;
    background: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}

.tab:hover {
    border-color: #00d4ff;
}

.tab.active {
    background: #00d4ff;
    color: #000;
    border-color: #00d4ff;
}

.tab-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 8px;
}

.tab.active .tab-count {
    background: rgba(0, 0, 0, 0.2);
}

/* Commands List */
.commands-list {
    display: none;
}

.commands-list.active {
    display: block;
}

/* Command Card */
.command-card {
    background: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.command-card:hover {
    border-color: #3a3a5a;
}

.command-card.hidden {
    display: none;
}

.command-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.command-name {
    font-size: 1.2rem;
    font-weight: 600;
}

.command-category {
    color: #888;
    font-size: 0.85rem;
}

/* Votes */
.votes {
    display: flex;
    gap: 8px;
}

.vote-btn {
    background: #2a2a4a;
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    color: #fff;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.vote-btn:hover {
    background: #3a3a5a;
}

.vote-btn.active-up {
    background: #22c55e;
}

.vote-btn.active-down {
    background: #ef4444;
}

/* Command Options */
.command-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    align-items: center;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-group label {
    color: #888;
    font-size: 0.9rem;
}

.option-group input[type="number"] {
    width: 80px;
    padding: 8px 10px;
    background: #2a2a4a;
    border: 1px solid #3a3a5a;
    border-radius: 5px;
    color: #fff;
    font-size: 0.9rem;
}

.option-group input[type="number"]:focus {
    outline: none;
    border-color: #00d4ff;
}

.option-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Command Output */
.command-output {
    background: #0d0d1a;
    border-radius: 5px;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    position: relative;
}

/* Spawn Coordinates */
.spawn-coords {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 12px;
}

.coords-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

.coord-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.coord-group label {
    color: #00d4ff;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: help;
}

.coord-group input {
    width: 65px;
    padding: 5px 8px;
    background: #0d0d1a;
    border: 1px solid #3a3a5a;
    border-radius: 4px;
    color: #fff;
    font-size: 0.85rem;
    text-align: center;
}

.coord-group input:focus {
    outline: none;
    border-color: #00d4ff;
}

.coords-hint {
    color: #666;
    font-size: 0.7rem;
    margin-top: 6px;
    font-style: italic;
}

.command-text {
    display: block;
    padding-right: 80px;
    color: #00d4ff;
}

.copy-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #2a2a4a;
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #3a3a5a;
}

.copy-btn.copied {
    background: #22c55e;
}

/* Stack Warning */
.stack-warning {
    display: none;
    margin-top: 10px;
    padding: 10px 15px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 5px;
    color: #eab308;
    font-size: 0.85rem;
}

.stack-warning.visible {
    display: block;
}

/* GFI Warning */
.gfi-warning {
    margin-left: 10px;
    padding: 4px 8px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 5px;
    color: #f97316;
    font-size: 0.75rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .gfi-warning {
        display: none;
    }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mod-header {
        padding: 15px;
    }

    .mod-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .breadcrumbs {
        font-size: 0.8rem;
    }

    .mod-title {
        font-size: 1.2rem;
        gap: 10px;
    }

    .mod-title-name {
        font-size: 1.25rem;
    }

    .mod-title-image,
    .mod-title-icon {
        width: 40px;
        height: 40px;
    }

    .mod-title-creator {
        font-size: 0.8rem;
    }

    .mod-title-project-id,
    .mod-title-updated {
        font-size: 0.75rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .command-header {
        flex-direction: column;
    }

    .command-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .command-text {
        padding-right: 0;
        margin-bottom: 10px;
        font-size: 0.78rem;
    }

    .copy-btn {
        position: relative;
        transform: none;
        right: auto;
        top: auto;
        width: 100%;
        margin-top: 10px;
    }

    .search-bar {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .mod-title-name {
        font-size: 1.1rem;
    }

    .mod-title-image,
    .mod-title-icon {
        width: 36px;
        height: 36px;
    }

    .tab {
        padding: 7px 12px;
        font-size: 0.85rem;
    }

    .tab-count {
        font-size: 0.7rem;
        padding: 1px 6px;
    }
}


/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #22c55e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* NEW Badge */
.badge-new {
    background: #22c55e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
}

/* Command Actions */
.command-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Favorite Button */
.fav-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    padding: 5px;
}

.fav-btn:hover {
    color: #fbbf24;
    transform: scale(1.1);
}

.fav-btn.active {
    color: #fbbf24;
}

/* Share Button */
.share-btn {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    padding: 5px;
}

.share-btn:hover {
    color: #00d4ff;
}

/* Highlighted Card (from share link) */
.command-card.highlight {
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    animation: pulse 0.5s ease 3;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 30px rgba(0, 212, 255, 0.5); }
}

/* Command Help Text */
.command-help {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #aaa;
}

.command-help strong {
    color: #00d4ff;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 30px;
    color: #666;
}

.loading-indicator.hidden {
    display: none;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* NEW Badge */
.badge-new {
    display: inline-block;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: pulse-new 2s ease-in-out infinite;
}

@keyframes pulse-new {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Mobile adjustments for new elements */
@media (max-width: 768px) {
    .command-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .toast {
        left: 20px;
        right: 20px;
        transform: translateX(0) translateY(100px);
        text-align: center;
    }
    
    .toast.show {
        transform: translateX(0) translateY(0);
    }
    
    .command-help {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    
    .spawn-coords {
        padding: 10px 12px;
    }
    
    .coords-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .coord-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .coord-group input {
        width: 80px;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: #00d4ff;
    color: #000;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}


/* Color Button */
.color-btn {
    background: none;
    border: 1px solid #3a3a5a;
    border-radius: 5px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}
.color-btn:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

/* Color Modal Overlay */
.color-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.color-modal-overlay.active {
    display: flex;
}

/* Color Modal */
.color-modal {
    background: #1a1a2e;
    border: 1px solid #3a3a5a;
    border-radius: 12px;
    width: 95%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.color-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #2a2a4a;
}
.color-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
}
.color-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}
.color-modal-close:hover {
    color: #fff;
}

.color-modal-body {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Color Region Row */
.color-region {
    display: flex;
    align-items: center;
    gap: 12px;
}
.color-region-label {
    color: #00d4ff;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 75px;
    white-space: nowrap;
}
.color-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.color-preview {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    border: 2px solid #555;
    flex-shrink: 0;
}

/* Custom Searchable Color Dropdown */
.color-dropdown {
    position: relative;
    flex: 1;
}
.color-search {
    width: 100%;
    padding: 8px 10px;
    background: #2a2a4a;
    border: 1px solid #3a3a5a;
    border-radius: 5px;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    box-sizing: border-box;
}
.color-search:focus {
    outline: none;
    border-color: #00d4ff;
}
.color-dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: #1e1e36;
    border: 1px solid #3a3a5a;
    border-top: none;
    border-radius: 0 0 5px 5px;
    z-index: 1010;
}
.color-dropdown-list.open {
    display: block;
}
.color-dropdown-list.flip-up {
    top: auto;
    bottom: 100%;
    border-radius: 5px 5px 0 0;
    border: 1px solid #3a3a5a;
    border-bottom: none;
}
.color-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.color-option:hover {
    background: #2a2a4a;
}
.color-option-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid #555;
    flex-shrink: 0;
}
.color-option-id {
    color: #888;
    font-size: 0.8rem;
    min-width: 28px;
    text-align: right;
}
.color-option-name {
    color: #ddd;
    font-size: 0.85rem;
}

/* Color Modal Output */
.color-modal-output {
    padding: 15px 20px;
    border-top: 1px solid #2a2a4a;
}
.color-command-text {
    background: #0d0d1a;
    border-radius: 5px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    color: #00d4ff;
    word-break: break-all;
    margin-bottom: 12px;
    line-height: 1.5;
}
.color-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.color-reset-btn {
    padding: 8px 16px;
    background: #2a2a4a;
    border: 1px solid #3a3a5a;
    border-radius: 5px;
    color: #888;
    cursor: pointer;
    font-size: 0.85rem;
}
.color-reset-btn:hover {
    border-color: #666;
    color: #fff;
}
.color-copy-btn {
    padding: 8px 20px;
    background: #00d4ff;
    border: none;
    border-radius: 5px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.color-copy-btn:hover {
    background: #00b8d9;
}

/* Mobile Color Modal */
@media (max-width: 768px) {
    .color-modal {
        width: 95%;
        max-height: 85vh;
    }
    .color-region {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .color-select-wrap {
        width: 100%;
    }
    .color-modal-buttons {
        flex-direction: column;
    }
    .color-copy-btn, .color-reset-btn {
        width: 100%;
        text-align: center;
    }
}