/* Custom Styles for Game Emulator */

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Toast Notifications */
.toast {
    animation: slideIn 0.3s ease-out;
    min-width: 300px;
    max-width: 500px;
}

.toast.hide {
    animation: slideOut 0.3s ease-in;
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border-left: 4px solid #047857;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-left: 4px solid #b91c1c;
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-left: 4px solid #1d4ed8;
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-left: 4px solid #b45309;
}

/* Game Cards */
.game-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border: 1px solid #334155;
    position: relative;
    z-index: 1;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    z-index: 2;
}

/* When dropdown is active */
.game-card.dropdown-active {
    z-index: 100;
}

.game-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-card.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #334155;
}

/* Provider Cards - Horizontal Layout */
.provider-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #1e293b, #334155);
    border: 1px solid #0f172a;
    min-width: 160px;
    border-radius: 8px;
}

.provider-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

.provider-card.active {
    background: linear-gradient(135deg, #334155, #3b82f6);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Horizontal scroll for providers */
#providers-container {
    scrollbar-width: thin;
    scrollbar-color: #334155 #000000;
}

#providers-container::-webkit-scrollbar {
    height: 6px;
}

#providers-container::-webkit-scrollbar-track {
    background: #000000;
    border-radius: 3px;
}

#providers-container::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

#providers-container::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #334155, #1e293b);
    border: 1px solid #3b82f6;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1e293b, #334155);
    border-color: #2563eb;
    transform: translateY(-2px);
}

/* Form Elements */
.form-input {
    background: #0f172a;
    border: 1px solid #334155;
    transition: all 0.3s ease;
    color: #e5e7eb !important;
}

.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #1e293b;
    color: #ffffff !important;
}

.form-input::placeholder {
    color: #6b7280 !important;
}

/* Force text color for autofill */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #e5e7eb !important;
    -webkit-box-shadow: 0 0 0px 1000px #0f172a inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* For all input, select, textarea elements */
input, select, textarea {
    color: #e5e7eb !important;
}

input::placeholder,
select::placeholder,
textarea::placeholder {
    color: #6b7280 !important;
}

/* Number input arrows color fix */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Modal */
.modal-overlay {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border: 1px solid #334155;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Game Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
}

/* Provider Grid - Removed, now using horizontal layout */

/* Search and Filter */
.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.search-input {
    padding-left: 40px;
}

/* Status Indicators */
.status-online {
    color: #10b981;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.status-online i {
    display: inline-block;
    animation: pulse-glow-green 2s ease-in-out infinite;
}

@keyframes pulse-glow-green {

    0%,
    100% {
        text-shadow: 0 0 2px #10b981;
    }

    50% {
        text-shadow: 0 0 8px #10b981, 0 0 12px #10b981;
    }
}

.status-offline {
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.status-offline i {
    display: inline-block;
    animation: pulse-glow-red 2s ease-in-out infinite;
}

@keyframes pulse-glow-red {

    0%,
    100% {
        text-shadow: 0 0 2px #ef4444;
    }

    50% {
        text-shadow: 0 0 8px #ef4444, 0 0 12px #ef4444;
    }
}

.status-maintenance {
    color: #f59e0b;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.status-maintenance i {
    display: inline-block;
    animation: pulse-glow-orange 2s ease-in-out infinite;
}

@keyframes pulse-glow-orange {

    0%,
    100% {
        text-shadow: 0 0 2px #f59e0b;
    }

    50% {
        text-shadow: 0 0 8px #f59e0b, 0 0 12px #f59e0b;
    }
}

/* Balance Display */
.balance-display {
    background: linear-gradient(135deg, #334155, #1e293b);
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 1rem;
}

/* RTP Control */
.rtp-control {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1rem;
}

.rtp-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #334155;
    outline: none;
}

.rtp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.rtp-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

/* Demo Spin Control */
.demo-spin-control {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .user-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #334155, #1e293b);
}

.border-gradient {
    border: 1px solid transparent;
    background: linear-gradient(135deg, #0f172a, #1e293b) padding-box,
        linear-gradient(135deg, #3b82f6, #2563eb) border-box;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Layout Dropdown */
.layout-dropdown-container {
    position: relative;
    z-index: 10;
}

/* When dropdown is open, increase z-index of parent card */
.game-card:has(.layout-dropdown:not(.hidden)) {
    z-index: 100;
}

.layout-dropdown {
    min-width: 180px;
    white-space: nowrap;
    margin-top: 0.25rem;
    z-index: 999;
    position: absolute;
}

.layout-dropdown a {
    transition: all 0.2s ease;
    color: #e5e7eb;
}

.layout-dropdown a:hover:not(.cursor-not-allowed) {
    background: rgba(59, 130, 246, 0.2);
    color: #ffffff;
}

.layout-dropdown a.cursor-not-allowed {
    opacity: 0.5;
}

.layout-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.layout-dropdown img {
    object-fit: contain;
    display: block;
    margin: 0 auto;
}