/* PlayersAreGamers.nl - Custom Styles */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #1f2937;
    --darker-bg: #111827;
    --card-bg: #374151;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #f3f4f6;
    min-height: 100vh;
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideInLeft 0.5s ease-out;
}

/* Custom Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--card-bg);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
}

.card-highlight {
    border: 2px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.card-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.card-highlight:hover::before {
    left: 100%;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

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

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

/* Coin Display */
.coin-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    color: #78350f;
    box-shadow: 0 4px 6px rgba(251, 191, 36, 0.3);
    transition: all 0.3s ease;
}

.coin-display:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(251, 191, 36, 0.4);
}

.coin-icon {
    width: 24px;
    height: 24px;
    animation: bounce 2s infinite;
}

/* Wallet Display */
.wallet-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.wallet-display:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.4);
}

/* Forms */
.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--dark-bg);
    border: 2px solid transparent;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #d1d5db;
}

/* Navigation */
.nav-link {
    color: #d1d5db;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    color: white;
    background: rgba(99, 102, 241, 0.2);
}

.nav-link.active {
    color: white;
    background: var(--primary-color);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--dark-bg);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success-color);
    color: #6ee7b7;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger-color);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--warning-color);
    color: #fcd34d;
}

.alert-info {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary-color);
    color: #c7d2fe;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.5);
    animation: slideInLeft 0.3s ease;
}

/* Game Container Styles */
#game-container {
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

/* Scoreboard */
.scoreboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--dark-bg);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.scoreboard-item:hover {
    background: var(--card-bg);
    transform: translateX(4px);
}

.scoreboard-rank {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .card {
        padding: 16px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 0.875rem;
    }
    
    .coin-display,
    .wallet-display {
        padding: 6px 12px;
        font-size: 0.875rem;
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.border-gradient {
    border: 2px solid transparent;
    background-image: linear-gradient(var(--card-bg), var(--card-bg)), 
                      linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* =============================================
   MOBILE-FRIENDLY ENHANCEMENTS
   Added for comprehensive mobile responsiveness
   ============================================= */

/* Prevent horizontal overflow globally */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Ensure all images and media scale */
img, video, iframe, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* Tables: scrollable on small screens */
table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Small screen adjustments (480px and below) */
@media (max-width: 480px) {
    .card {
        padding: 12px;
        border-radius: 8px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 8px 16px;
        font-size: 0.8125rem;
        width: 100%;
        text-align: center;
    }

    .coin-display,
    .wallet-display {
        padding: 4px 10px;
        font-size: 0.8125rem;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    /* Modal adjustments for small screens */
    .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 85vh;
        overflow-y: auto;
    }

    /* Scoreboard compact */
    .scoreboard-item {
        padding: 8px;
        font-size: 0.875rem;
    }

    .scoreboard-rank {
        font-size: 1rem;
    }

    /* Game container fill width */
    #game-container {
        border-width: 2px;
        border-radius: 8px;
    }
}

/* Medium-small screens (481px - 768px) */
@media (max-width: 768px) {
    /* Ensure containers don't overflow */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Fix any fixed-width elements */
    [class*="w-64"] {
        max-width: 100%;
    }

    /* Ensure flex items wrap */
    .flex {
        flex-wrap: wrap;
    }

    /* Nav items spacing */
    nav .flex {
        gap: 0.5rem;
    }
}

/* Touch-friendly: larger tap targets on mobile */
@media (max-width: 768px) {
    a, button, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    input, select, textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

/* Fix: Ensure input text is visible on light backgrounds (login, register, etc.) */
.bg-white input,
.bg-white select,
.bg-white textarea {
    color: #1f2937 !important;
    -webkit-text-fill-color: #1f2937 !important;
    background-color: #ffffff !important;
}

.bg-white input::placeholder,
.bg-white select::placeholder,
.bg-white textarea::placeholder {
    color: #9ca3af !important;
    -webkit-text-fill-color: #9ca3af !important;
}

/* Override browser autofill styles */
.bg-white input:-webkit-autofill,
.bg-white input:-webkit-autofill:hover,
.bg-white input:-webkit-autofill:focus {
    -webkit-text-fill-color: #1f2937 !important;
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    box-shadow: 0 0 0px 1000px #ffffff inset !important;
}

.bg-white label,
.bg-white p,
.bg-white h1,
.bg-white h2,
.bg-white h3 {
    color: inherit;
}
