/* Script Page Container */
.game-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    min-height: 100vh;
}

.search-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 600px;
    min-width: 280px;
}

.game-search-input {
    width: -webkit-fill-available !important;
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(30, 30, 30, 0.7);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.game-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 188, 221, 0.2);
}

.search-button {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #868686;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.search-button:hover {
    color: var(--primary-color);
}

.random-game-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 75px rgba(91, 188, 221, 0.7);
}

.random-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(91, 188, 221, 0.6);
}

.random-game-btn:active {
    transform: translateY(0);
}

/* Category Navigation */
.category-nav {
    margin-bottom: 2rem;
}

.category-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1rem;
    border-radius: 16px;
}

.category-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: rgba(60, 60, 60, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.category-button:hover {
    background: rgba(80, 80, 80, 0.8);
    transform: translateY(-2px);
}

.category-button.active {
    background: var(--primary-color) !important;
    border-color: var(--primary-dark);
    color: white;
    box-shadow: 0 0 75px rgba(91, 188, 221, 0.7);
    transform: translateY(-2px);
}

.category-icon {
    font-size: 1.2rem;
}

.lock-icon {
    color: white;
    margin-left: 0.5rem;
}

/* Script Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.game-card {
    background: rgba(30, 30, 30, 0.9);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    height: 320px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

.game-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    background: #1a1a1a;
    max-height: 200px;
    overflow: hidden;
}

.game-overlay {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(30, 30, 30, 0.95);
}

.game-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #ccc;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.stat-item i {
    color: var(--primary-color);
    font-size: 0.7rem;
}

.game-author {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
    font-style: italic;
}

.game-category {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
    margin: 0;
    text-transform: capitalize;
}

/* Search Results Info */
.search-results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(30, 30, 30, 0.7);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.clear-search-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clear-search-button:hover {
    background: var(--primary-dark);
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(25, 28, 36, 0.95) 0%, rgba(15, 17, 23, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-top: 8px;
}

.search-results-dropdown.visible {
    display: block;
}

/* Remove custom scrollbar styles for .search-results-dropdown */

.search-results-dropdown::-webkit-scrollbar,
.search-results-dropdown::-webkit-scrollbar-thumb,
.search-results-dropdown::-webkit-scrollbar-track {
  all: unset;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
    position: relative;
    color: rgba(255, 255, 255, 0.85);
}

.search-result-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-left-color: var(--primary-color, #259cd4);
    transform: translateX(2px);
    color: #ffffff;
}

.search-result-item:active {
    transform: translateX(2px) scale(0.98);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    font-size: 15px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'DM Sans', sans-serif;
}

.search-result-category {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    background: rgba(30, 30, 30, 0.9);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.pagination button:hover {
    background: var(--primary-color-dark);
    transform: translateY(-2px);
}

.pagination button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.pagination .current-page {
    background: var(--primary-color-dark);
    font-weight: bold;
}

.pagination .page-info {
    margin: 0 1rem;
    color: #ccc;
    font-weight: 500;
}

.pagination .page-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    width: 60px;
    text-align: center;
    margin: 0 0.5rem;
}

.pagination .page-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.pagination .go-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    margin-left: 0.5rem;
}

.pagination .go-button:hover {
    background: var(--primary-color-dark);
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(91, 188, 221, 0.3);
}

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

.scroll-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Modal Styles */
.game-preview-modal,
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.game-preview-modal.visible,
.login-modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(30, 30, 30, 0.95);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    backdrop-filter: blur(10px);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-body {
    margin-top: 1rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(60, 60, 60, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(80, 80, 80, 0.8);
    transform: translateY(-2px);
}

/* Mobile Responsiveness */
@media (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .game-page-container {
        padding: 1rem;
    }

    .search-wrapper {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box {
        width: 100%;
        max-width: none;
    }

    .random-game-btn {
        width: 100%;
        justify-content: center;
    }

    .category-container {
        gap: 0.5rem;
    }

    .category-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 0.75rem;
        padding: 0.5rem;
    }
    
    .game-card {
        height: 280px;
    }
    
    .game-image {
        height: 160px;
        max-height: 160px;
        object-position: center;
    }
    
    .game-overlay {
        padding: 0.75rem;
    }
    
    .game-title {
        font-size: 1rem;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }

    .pagination-section {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pagination-container {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .pagination-button {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .pagination-dropdown {
        width: 100%;
        text-align: center;
    }

    .pagination-dropdown select {
        width: 100%;
        max-width: 200px;
    }

    .search-results-dropdown {
        max-height: 250px;
    }
    
    .loading-content {
        margin: 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }
    
    .game-card {
        height: 240px;
    }
    
    .game-image {
        height: 120px;
        max-height: 120px;
        object-position: center;
    }
    
    .game-overlay {
        padding: 0.5rem;
    }
    
    .game-title {
        font-size: 0.9rem;
    }
    
    .game-category {
        font-size: 0.8rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-card {
    animation: fadeIn 0.5s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.5);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.page-jump-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-jump {
    background: rgba(60, 60, 60, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    width: 60px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.page-jump:hover {
    background: rgba(80, 80, 80, 0.8);
}

.page-jump-icon {
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.3s ease;
}

.page-jump-icon:hover {
    color: var(--primary-color);
}

.page-jump option {
    background: rgba(30, 30, 30, 0.95);
    color: white;
}

/* Error and Loading States */
.error-message {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff0000;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
    font-weight: 500;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* No results state */
.no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Keywords/Tags Styling */
.script-tag {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.125rem;
    text-transform: lowercase;
}

.script-tag:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
}

.keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0.5rem 0;
}

/* Category Buttons */
.category-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.category-btn {
    background: rgba(30, 30, 30, 0.9);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: white;
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
} 