/*
╔═══════════════════════════════════════════════════════════╗
║  PORTALE RICHIESTE GIOCHI NINTENDO - Main Stylesheet      ║
║  Stile: Nintendo Premium - Rosso & Moderno + Dark Mode    ║
╚═══════════════════════════════════════════════════════════╝
*/

/* ========================================
   RESET & VARIABILI
======================================== */
:root {
    /* Colori Brand Nintendo */
    --nintendo-red: #E60012;
    --nintendo-red-dark: #C4000F;
    --nintendo-green: #00A859;
    
    /* Colori Testo */
    --text-primary: #2B2B2B;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    
    /* Sfondi */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --card-bg: #FFFFFF;
    --card-hover: #FAFAFA;
    --input-bg: #FFFFFF;
    
    /* Bordi */
    --border-color: #E0E0E0;
    --border-light: #EEEEEE;
    --input-border: #E0E0E0;
    --input-focus-shadow: rgba(230, 0, 18, 0.15);
    
    /* Ombre */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    /* Flash Messages */
    --flash-success-bg: #d4edda;
    --flash-success-text: #155724;
    --flash-success-border: #c3e6cb;
    --flash-error-bg: #f8d7da;
    --flash-error-text: #721c24;
    --flash-error-border: #f5c6cb;
    
    /* Altro */
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ========================================
   BODY & LAYOUT BASE
======================================== */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ========================================
   FORM BOX (Login/Register)
======================================== */
.form-box {
    background: var(--card-bg);
    padding: 40px 35px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--nintendo-red) 0%, #FF6B6B 100%);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   TITOLI
======================================== */
h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: var(--nintendo-red);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

h2 i {
    margin-right: 8px;
    font-size: 26px;
    vertical-align: middle;
}

/* ========================================
   SUBTITLE (sotto i titoli h2)
======================================== */
.subtitle {
    margin-top: 8px;
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========================================
   INPUT GROUPS
======================================== */
.input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.input-group input,
.input-group select {
    width: 100%;
    height: 54px;
    padding: 16px 48px 16px 16px;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    background: var(--input-bg);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.input-group input::placeholder {
    color: var(--text-tertiary);
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--nintendo-red);
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
    transform: translateY(-2px);
}

.input-group i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: var(--transition);
}

.input-group input:focus~i,
.input-group select:focus~i {
    color: var(--nintendo-red);
}

/* ========================================
   BOTTONI
======================================== */
button,
.btn {
    width: 100%;
    height: 54px;
    padding: 0 24px;
    background: var(--nintendo-red);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.3);
    text-decoration: none;
}

button:hover,
.btn:hover {
    background: var(--nintendo-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 0, 18, 0.4);
}

button:active,
.btn:active {
    transform: translateY(0);
}

button i,
.btn i {
    font-size: 18px;
}

/* ========================================
   FLASH MESSAGES
======================================== */
.flash {
    margin-bottom: 24px;
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    animation: slideDown 0.4s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash.success {
    background: var(--flash-success-bg);
    color: var(--flash-success-text);
    border: 2px solid var(--flash-success-border);
}

.flash.success::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.flash.error {
    background: var(--flash-error-bg);
    color: var(--flash-error-text);
    border: 2px solid var(--flash-error-border);
}

.flash.error::before {
    content: '✕';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

/* ========================================
   LINK E TESTO
======================================== */
p {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

a {
    color: var(--nintendo-red);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

a:hover {
    color: var(--nintendo-red-dark);
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--nintendo-red);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

a.public-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid var(--border-color);
}

a.public-link:hover {
    border-color: var(--nintendo-red);
}

a.public-link::after {
    display: none;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .form-box {
        padding: 30px 24px;
    }

    h2 {
        font-size: 24px;
    }

    .input-group input,
    .input-group select,
    button,
    .btn {
        height: 50px;
        font-size: 14px;
    }

    button i,
    .btn i {
        font-size: 16px;
    }
}

/* ========================================
   ACCESSIBILITY
======================================== */
*:focus-visible {
    outline: 3px solid var(--nintendo-red);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   PAGINA RICHIESTE - request.php
======================================== */
.counter-box {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.01);
    }
}

.counter-box p {
    margin: 8px 0;
    font-size: 15px;
    color: var(--text-primary);
}

.counter-box b {
    color: var(--nintendo-red);
    font-size: 18px;
    font-weight: 700;
}

.counter-box .note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
    display: block;
}

.counter-box .error-text {
    color: #c4000f;
    font-weight: 600;
}

.counter-box .time-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.counter-box .time-note #orario {
    font-weight: 600;
    color: var(--nintendo-red);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.badge-requests {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    background: var(--nintendo-red);
    color: white;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
    margin: 0 4px;
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.3);
}

.badge-requests.low {
    background: #FF8C00;
}

.badge-requests.zero {
    background: #999;
}

.input-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23E60012' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    padding-right: 45px;
    cursor: pointer;
}

.input-group select option {
    padding: 10px;
}

.links {
    margin-top: 20px;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    font-size: 13px;
}

.links a:hover {
    border-color: var(--nintendo-red);
    transform: translateY(-2px);
}

.links a::after {
    display: none;
}

/* ========================================
   PAGINA PROFILO - profilo.php
======================================== */
.box {
    background: var(--card-bg);
    padding: 40px 35px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--nintendo-red) 0%, #FF6B6B 100%);
}

.status {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 18px;
    margin: 20px 0;
    border: 2px solid var(--border-color);
}

.status strong {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    margin-top: 8px;
}

.status span.ok {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.status span.no {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.status small {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

/* ========================================
   TABELLE - my_requests.php & lista_pubblica.php
======================================== */
.page-header {
    text-align: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.actions-top {
    max-width: 1000px;
    margin: 0 auto 25px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.btn.home,
.btn.register {
    width: auto;
    height: 48px;
    padding: 0 24px;
    border: 2px solid var(--nintendo-red);
    box-shadow: var(--shadow-sm);
}

.btn.home {
    background: var(--nintendo-red);
    color: #ffffff;
}

.btn.home:hover {
    background: #ffffff;
    color: var(--nintendo-red);
}

.btn.register {
    background: #ffffff;
    color: var(--nintendo-red);
}

.btn.register:hover {
    background: var(--nintendo-red);
    color: #ffffff;
}

.search-box {
    width: 100%;
    max-width: 1000px;
    margin: 10px auto 20px;
    padding: 0 10px;
}

.search-box input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 10px;
    border: 2px solid var(--input-border);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    background: var(--input-bg);
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

.search-box input:focus {
    border-color: var(--nintendo-red);
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
    transform: translateY(-2px);
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 auto;
    max-width: 1000px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 700px;
    background: var(--card-bg);
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
    font-size: 14px;
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: var(--card-hover);
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: #fff;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.badge.pending {
    background: #FF8C00;
}

.badge.approved {
    background: #00A859;
}

.badge.rejected {
    background: var(--nintendo-red);
}

.note {
    font-size: 12px;
    color: var(--text-secondary);
}

.motivo {
    font-size: 13px;
    font-weight: 500;
    color: var(--nintendo-red);
    font-style: italic;
}

.scroll-hint {
    display: none;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.scroll-hint i {
    color: var(--nintendo-red);
    margin-right: 5px;
}

/* ========================================
   RESPONSIVE TABLES
======================================== */
@media (max-width: 768px) {
    .scroll-hint {
        display: block;
    }

    th,
    td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    .actions-top {
        flex-direction: column;
    }

    .btn.home,
    .btn.register {
        width: 100%;
    }
}

/* ========================================
   UTILITIES
======================================== */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

/* ========================================
   LEGAL LINKS
======================================== */
.legal-links {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.legal-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 400;
}

.legal-links a:hover {
    color: var(--nintendo-red);
}

.legal-links a::after {
    display: none;
}

.legal-links span {
    color: var(--border-color);
}

/* ========================================
   TERMS CHECKBOX
======================================== */
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0;
    text-align: left;
}

.terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--nintendo-red);
    cursor: pointer;
    flex-shrink: 0;
}

.terms-checkbox label {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    cursor: pointer;
}

.terms-checkbox label a {
    color: var(--nintendo-red);
    font-weight: 600;
}

.terms-checkbox label a:hover {
    text-decoration: underline;
}

.terms-checkbox label a::after {
    display: none;
}

/* ========================================
   FOOTER COPYRIGHT
======================================== */
.footer-copyright {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}