/* Futuristic Modern Design */
:root {
    --primary-color: #00d4ff;
    --primary-gradient: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --secondary-color: #ff6b35;
    --accent-color: #6c5ce7;
    --success-color: #00cec9;
    --warning-color: #fdcb6e;
    --error-color: #e17055;
    
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: rgba(26, 26, 26, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);
    
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(0, 212, 255, 0.3);
    
    --shadow-primary: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.2);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(108, 92, 231, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255, 107, 53, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { transform: translateX(0) translateY(0) scale(1); }
    33% { transform: translateX(-10px) translateY(-10px) scale(1.02); }
    66% { transform: translateX(10px) translateY(10px) scale(0.98); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    padding: 40px 0 60px;
    text-align: center;
    position: relative;
}

.header-content {
    position: relative;
    z-index: 2;
}

.title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5)); }
}

.title-icon {
    font-size: 1.2em;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.subtitle {
    font-size: 0.4em;
    font-weight: 400;
    color: var(--text-secondary);
    background: none;
    -webkit-text-fill-color: var(--text-secondary);
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--primary-gradient);
    opacity: 0.5;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    border-color: var(--border-glow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header i {
    color: var(--primary-color);
}

/* Info Badge */
.info-badge {
    background: var(--primary-gradient);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-glow);
}

/* Input Groups */
.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    margin-bottom: 24px;
    align-items: end;
}

.input-wrapper {
    position: relative;
}

.input-field {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: var(--transition);
}

.input-field:focus + .input-icon,
.input-field:not(:placeholder-shown) + .input-icon {
    color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 16px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    min-width: 120px;
}

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

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.btn-add:hover {
    background: #00b8b5;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--border-glow);
}

/* Lista de Alunos */
.alunos-container {
    margin-top: 24px;
}

.lista-alunos {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Scrollbar personalizada */
.lista-alunos::-webkit-scrollbar {
    width: 6px;
}

.lista-alunos::-webkit-scrollbar-track {
    background: var(--bg-glass);
    border-radius: 3px;
}

.lista-alunos::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.aluno-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aluno-item:hover {
    border-color: var(--border-glow);
    background: rgba(255, 255, 255, 0.08);
}

.aluno-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aluno-numero {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.aluno-nome {
    font-weight: 600;
    color: var(--text-primary);
}

.aluno-cr {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.btn-remove {
    background: var(--error-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    background: #d63031;
    transform: scale(1.1);
}

.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Results Section */
.results-section {
    margin-top: 40px;
    animation: fadeInUp 0.5s ease-out;
}

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

.simulation-info {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.simulation-info > div {
    background: var(--bg-glass);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    margin: 32px 0;
}

.result-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    backdrop-filter: blur(10px);
}

.result-card h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chamada-exemplo {
    display: grid;
    gap: 8px;
}

.chamada-item {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid var(--primary-color);
    animation: slideInLeft 0.3s ease-out;
    animation-delay: calc(var(--delay) * 0.1s);
}

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

.posicao-numero {
    background: var(--primary-gradient);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.chart-card {
    position: relative;
    min-height: 400px;
}

.chart-card canvas {
    max-height: 350px !important;
}

/* Table */
.table-card {
    margin-top: 32px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    backdrop-filter: blur(10px);
}

.table-card h3 {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.results-table th,
.results-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    background: var(--bg-primary);
    color: var(--primary-color);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table tr:hover {
    background: var(--bg-glass);
}

.results-table .student-name {
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
}

.results-table .total-column {
    background: var(--bg-glass);
    font-weight: 600;
    color: var(--primary-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

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

.loading-content h3 {
    margin-bottom: 8px;
    color: var(--primary-color);
}

.loading-content p {
    color: var(--text-secondary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .card {
        padding: 20px;
    }
    
    .input-group {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .simulation-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .card-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px 0 40px;
    }
    
    .card {
        padding: 16px;
    }
    
    .input-field {
        padding: 14px 14px 14px 44px;
    }
    
    .btn {
        padding: 14px 20px;
    }
}

/* Animações de entrada */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efeitos de hover especiais */
.glow-on-hover {
    transition: var(--transition);
}

.glow-on-hover:hover {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* Chart.js customizations */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Success/Error states */
.success-state {
    border-color: var(--success-color) !important;
    box-shadow: 0 0 10px rgba(0, 206, 201, 0.2) !important;
}

.error-state {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 10px rgba(225, 112, 85, 0.2) !important;
}