/* ===== CALISTHENICS AI - MODERN DESIGN 2025 ===== */

:root {
    /* Color Palette */
    --primary-red: #b30000;
    --primary-red-hover: #ff1a1a;
    --primary-red-light: #ff3333;
    --primary-black: #111;
    --primary-black-light: #1a1a1a;
    --primary-black-lighter: #2a2a2a;
    
    /* Gradients */
    --gradient-red: linear-gradient(135deg, #b30000 0%, #ff1a1a 100%);
    --gradient-dark: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
    --gradient-card: linear-gradient(145deg, #1a1a1a 0%, #2a2a2a 100%);
    
    /* Shadows */
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 4px 20px rgba(179, 0, 0, 0.15);
    --shadow-hover: 0 8px 40px rgba(179, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(179, 0, 0, 0.4);
    
    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-black);
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 2rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }

.text-gradient {
    background: var(--gradient-red);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== NAVBAR ===== */
.navbar {
    background: var(--gradient-red);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-soft);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: white !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.8rem;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-normal);
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ===== CARDS ===== */
.card {
    background: var(--gradient-card);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
    overflow: hidden;
    position: relative;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-red);
    opacity: 0;
    transition: var(--transition-normal);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    background: var(--gradient-red);
    color: white;
    border: none;
    padding: 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 2rem;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: var(--transition-normal);
    border: none;
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover {
    background: var(--primary-red-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-outline-primary {
    border: 2px solid var(--primary-red);
    color: var(--primary-red);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-red);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ===== FORMS ===== */
.form-control {
    background: var(--primary-black-lighter);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: white;
    padding: 1rem;
    font-size: 1rem;
    transition: var(--transition-normal);
}

.form-control:focus {
    background: var(--primary-black-lighter);
    border-color: var(--primary-red);
    box-shadow: 0 0 0 0.2rem rgba(179, 0, 0, 0.25);
    color: white;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ===== TABLES ===== */
.table {
    color: white;
    background: var(--primary-black-lighter);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.table th {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table td {
    border-color: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(179, 0, 0, 0.1);
    transform: scale(1.01);
    transition: var(--transition-normal);
}

/* ===== BADGES ===== */
.badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
}

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

.badge-secondary {
    background: var(--primary-black-lighter);
    color: rgba(255, 255, 255, 0.8);
}

.badge-warning {
    background: #ffc107;
    color: var(--primary-black);
}

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    font-weight: 500;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
    border-left: 4px solid #dc3545;
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    color: #51cf66;
    border-left: 4px solid #28a745;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    min-height: 100vh;
    background: var(--gradient-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(179,0,0,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(179,0,0,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(179,0,0,0.1)"/><circle cx="10" cy="60" r="0.5" fill="rgba(179,0,0,0.1)"/><circle cx="90" cy="40" r="0.5" fill="rgba(179,0,0,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.login-card {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 3rem;
    max-width: 450px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h1 {
    background: var(--gradient-red);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-logo p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

/* ===== DASHBOARD ===== */
.dashboard-welcome {
    background: var(--gradient-card);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}

.dashboard-welcome h1 {
    margin-bottom: 0.5rem;
}

.dashboard-welcome p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

.massimali-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.massimale-card {
    background: var(--gradient-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition-normal);
    border: 2px solid transparent;
}

.massimale-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-red);
    box-shadow: var(--shadow-hover);
}

.massimale-icon {
    font-size: 3rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.massimale-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.massimale-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.schede-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.scheda-card {
    background: var(--gradient-card);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    transition: var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    color: white;
    display: block;
}

.scheda-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    color: white;
    text-decoration: none;
}

.scheda-icon {
    font-size: 3rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.scheda-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.scheda-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* ===== EXERCISE PAGE ===== */
.exercise-header {
    background: var(--gradient-card);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}

.exercise-header h1 {
    margin-bottom: 0.5rem;
}

.exercise-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

.exercise-table-container {
    background: var(--gradient-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    overflow-x: auto;
}

.note-textarea {
    background: var(--primary-black-lighter);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: white;
    resize: none;
    transition: var(--transition-normal);
}

.note-textarea:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 0.2rem rgba(179, 0, 0, 0.25);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(179, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(179, 0, 0, 0.6);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-glow {
    animation: glow 2s infinite;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .login-card {
        padding: 2rem;
        margin: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .massimali-grid {
        grid-template-columns: 1fr;
    }
    
    .schede-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .dashboard-welcome {
        padding: 1.5rem;
    }
    
    .exercise-header {
        padding: 1.5rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-red { color: var(--primary-red) !important; }
.text-red-light { color: var(--primary-red-light) !important; }
.bg-red { background: var(--primary-red) !important; }
.bg-red-gradient { background: var(--gradient-red) !important; }
.bg-dark-card { background: var(--gradient-card) !important; }

.shadow-glow { box-shadow: var(--shadow-glow) !important; }
.shadow-soft { box-shadow: var(--shadow-soft) !important; }

.rounded-custom { border-radius: var(--radius-md) !important; }
.rounded-custom-lg { border-radius: var(--radius-lg) !important; }

.transition-fast { transition: var(--transition-fast) !important; }
.transition-normal { transition: var(--transition-normal) !important; }
.transition-slow { transition: var(--transition-slow) !important; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-black);
}

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

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

/* ===== PASSWORD REQUIREMENTS ===== */
.password-requirements {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
    padding: 1rem;
    background: var(--primary-black-lighter);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-red);
}

.password-requirements p {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-red);
}

.password-requirements ul {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.password-requirements li {
    margin-bottom: 0.25rem;
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-red);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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