@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;700&display=swap');

:root {
    --bg-dark: #0a0a0b;
    --sidebar-bg: #0f0f12;
    --accent-red: #d32f2f;
    --accent-red-glow: rgba(211, 47, 47, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #e0e0e0;
    --text-muted: #888888;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(211, 47, 47, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(211, 47, 47, 0.05) 0%, transparent 40%);
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: 0;
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--glass-border);
    z-index: 1000;
    transition: var(--transition);
}

.brand {
    font-family: 'Orbitron', sans-serif;
    color: var(--accent-red);
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 15px var(--accent-red-glow);
}

.nav-link {
    color: var(--text-muted);
    padding: 12px 20px;
    margin-bottom: 8px;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 12px;
}

.nav-link:hover, .nav-link.active {
    background: var(--glass-bg);
    color: white;
    transform: translateX(5px);
}

.nav-link.active {
    background: linear-gradient(90deg, var(--accent-red) 0%, transparent 100%);
    border-left: 4px solid var(--accent-red);
    color: white;
}

.nav-link.text-danger:hover {
    background: rgba(211, 47, 47, 0.1);
    color: #ff5252;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 3rem;
    max-width: 1400px;
}

h3 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    color: white;
}

/* Glass Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(211, 47, 47, 0.3);
}

.card-body {
    padding: 1.5rem;
}

/* Table Styling */
.table {
    margin-bottom: 0;
    color: var(--text-main);
    border-collapse: separate;
    border-spacing: 0 10px;
}

.table thead th {
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 1rem 1.5rem;
}

.table tbody tr {
    background-color: rgba(0, 0, 0, 0.2) !important;
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(211, 47, 47, 0.1) !important;
}

.table tbody tr.pk-row {
    background-color: rgba(211, 47, 47, 0.05) !important;
    opacity: 0.5;
    filter: grayscale(80%);
}

.table tbody tr.pk-row:hover {
    background-color: rgba(211, 47, 47, 0.15) !important;
    opacity: 0.8;
}

.table tbody tr.pk-row td .fw-bold {
    text-decoration: line-through;
    color: #888;
}

.table td {
    background: transparent !important;
    border: none;
    padding: 1.25rem 1.5rem;
    vertical-align: middle;
    color: var(--text-main) !important;
}

.table tr td:first-child { border-radius: 12px 0 0 12px; }
.table tr td:last-child { border-radius: 0 12px 12px 0; }

/* Buttons */
.btn {
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent-red);
    border: none;
    box-shadow: 0 4px 15px var(--accent-red-glow);
}

.btn-primary:hover {
    background: #ff1744;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-red-glow);
}

.btn-outline-success { border-color: #4caf50; color: #4caf50; }
.btn-outline-info { border-color: #00bcd4; color: #00bcd4; }
.btn-outline-warning { border-color: #ffc107; color: #ffc107; }
.btn-outline-danger { border-color: var(--accent-red); color: var(--accent-red); }

.btn-outline-success:hover { background: #4caf50; color: white; }
.btn-outline-info:hover { background: #00bcd4; color: white; }
.btn-outline-warning:hover { background: #ffc107; color: black; }
.btn-outline-danger:hover { background: var(--accent-red); color: white; }

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
}

.rank-badge {
    padding: 6px 15px;
    border-radius: 50px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rank-1 { background: rgba(224, 224, 224, 0.1); color: #e0e0e0; border: 1px solid #e0e0e0; }
.rank-2 { background: rgba(76, 175, 80, 0.1); color: #4caf50; border: 1px solid #4caf50; }
.rank-3 { background: rgba(33, 150, 243, 0.1); color: #2196f3; border: 1px solid #2196f3; }
.rank-4 { background: rgba(156, 39, 176, 0.1); color: #9c27b0; border: 1px solid #9c27b0; }

/* Modals */
.modal-content {
    background: rgba(15, 15, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem 2rem;
}

.modal-body {
    padding: 2rem;
}

.form-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    color: white !important;
    border-radius: 12px;
    padding: 12px 15px;
    transition: var(--transition);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--accent-red) !important;
    box-shadow: 0 0 15px var(--accent-red-glow);
}

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

.section {
    animation: fadeIn 0.5s ease-out forwards;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Wheel Styles */
.wheel-container {
    position: relative;
    width: 600px;
    height: 600px;
    margin: 50px auto;
    border-radius: 50%;
    border: 10px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    background: #111;
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--accent-red);
    z-index: 100;
    filter: drop-shadow(0 0 10px var(--accent-red));
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    transition: transform 8s cubic-bezier(0.1, 0, 0.1, 1);
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.8);
}

.wheel-text {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 20px;
    margin-top: -10px;
    transform-origin: left center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    text-align: right;
    padding-right: 35px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-weight: 500;
    text-shadow: 1px 1px 3px #000;
}

.blur-text {
    filter: blur(3px);
    opacity: 0.7;
    margin: 0 2px;
    display: inline-block;
    user-select: none;
}

.wheel::after {
    content: 'CALABRIA';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: #000;
    border-radius: 50%;
    border: 4px solid var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--accent-red);
    text-shadow: 0 0 10px var(--accent-red);
    box-shadow: 0 0 30px var(--accent-red);
    z-index: 10;
}

.result-card {
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--accent-red);
    padding: 15px;
    border-radius: 8px;
    animation: slideInRight 0.5s ease backwards;
    backdrop-filter: blur(10px);
}

@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
