/* Sistema de Controle de Atrasos - Estilos CSS */

:root {
    --primary-color: #2563eb;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* Ranking */
.ranking-container {
    max-width: 800px;
    margin: 0 auto;
}

.ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    margin-bottom: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--primary-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ranking-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.ranking-item.first {
    border-left-color: #ffd700;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.ranking-item.second {
    border-left-color: #c0c0c0;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
}

.ranking-item.third {
    border-left-color: #cd7f32;
    background: linear-gradient(135deg, #fdf2e9 0%, #ffffff 100%);
}

.ranking-position {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.ranking-name {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 600;
    margin-left: 20px;
}

.ranking-points {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.emoji {
    font-size: 1.8rem;
}

/* Formulário de Admin */
.admin-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.checkbox-label {
    font-weight: normal;
    margin: 0;
    cursor: pointer;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

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

.btn-full {
    width: 100%;
}

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

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 100px auto;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--dark-color);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsivo */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .ranking-item {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .ranking-name {
        margin-left: 0;
    }
    
    .ranking-position,
    .ranking-points {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 15px;
    }
    
    .ranking-item {
        padding: 12px;
    }
}

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

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Utilitários */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }

.hidden { display: none; }
.visible { display: block; }



/* Estilos específicos para a página de ranking */

/* Header Info */
.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

#current-month {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Estatísticas */
.stats-card h3 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--dark-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

/* Pódio */
.podium-card h3 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-color);
}

.podium {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 20px;
    margin-bottom: 20px;
}

.podium-item {
    text-align: center;
    padding: 20px 15px;
    border-radius: 12px;
    min-width: 120px;
    transition: transform 0.3s ease;
}

.podium-item:hover {
    transform: scale(1.05);
}

.podium-item.first {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    height: 140px;
    order: 2;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.podium-item.second {
    background: linear-gradient(135deg, #c0c0c0 0%, #e5e5e5 100%);
    height: 120px;
    order: 1;
    box-shadow: 0 6px 20px rgba(192, 192, 192, 0.3);
}

.podium-item.third {
    background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
    height: 100px;
    order: 3;
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.3);
}

.podium-position {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.podium-name {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.podium-points {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark-color);
}

/* Ranking List */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--primary-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ranking-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(37, 99, 235, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ranking-item:hover::before {
    opacity: 1;
}

.ranking-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.ranking-item.highlight {
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
    border-left-color: #f59e0b;
}

.ranking-position {
    font-size: 1.8rem;
    font-weight: bold;
    min-width: 70px;
    text-align: center;
    color: var(--primary-color);
}

.ranking-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 20px;
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.ranking-details {
    font-size: 0.9rem;
    color: #64748b;
}

.ranking-points {
    text-align: right;
    min-width: 100px;
}

.ranking-points-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
}

.ranking-points-label {
    font-size: 0.8rem;
    color: #64748b;
}

.ranking-emoji {
    font-size: 2rem;
    margin-left: 15px;
}

/* Regras */
.rules-card h3 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--dark-color);
}

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

.rule-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: transform 0.2s ease;
}

.rule-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.rule-icon {
    font-size: 2rem;
    margin-right: 15px;
    min-width: 50px;
    text-align: center;
}

.rule-content {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 5px;
}

/* Estados especiais */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.empty-state p {
    font-size: 1rem;
    line-height: 1.6;
}

/* Responsivo específico */
@media (max-width: 768px) {
    .header-info {
        flex-direction: column;
        text-align: center;
    }
    
    .podium {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-item {
        width: 100%;
        max-width: 200px;
        height: auto !important;
        order: unset !important;
    }
    
    .ranking-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .ranking-avatar {
        margin: 0;
    }
    
    .ranking-info {
        text-align: center;
    }
    
    .ranking-points {
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .rules-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ranking-position {
        font-size: 1.4rem;
    }
    
    .ranking-points-number {
        font-size: 1.5rem;
    }
    
    .podium-position {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}


/* Estilos específicos para a página de administração */

/* Header Actions */
.header-actions {
    margin-top: 20px;
    text-align: center;
}

/* Login */
.login-container {
    max-width: 450px;
    margin: 80px auto;
}

.login-card {
    background: white;
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid var(--border-color);
}

.login-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.login-title {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.login-subtitle {
    color: #64748b;
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.5;
}

.login-form {
    text-align: left;
}

.login-help {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.login-help p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

/* Admin Panel */
.admin-panel {
    margin-bottom: 30px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-header h3 {
    margin: 0;
    color: var(--dark-color);
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-user {
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--dark-color);
    font-weight: 500;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: transform 0.2s ease;
}

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

.stat-icon {
    font-size: 2.5rem;
    margin-right: 15px;
    opacity: 0.8;
}

.stat-info {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

/* Formulário Admin */
.form-description {
    color: #64748b;
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.required {
    color: var(--danger-color);
    font-weight: bold;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.form-actions {
    margin-top: 35px;
    text-align: center;
}

/* Regras de Referência */
.rules-reference {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-left: 5px solid var(--primary-color);
}

.rules-reference h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
}

.rules-table {
    display: grid;
    grid-template-columns: 1fr 2fr 80px;
    gap: 1px;
    background: var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 25px;
}

.rule-row {
    display: contents;
}

.rule-row.header .rule-cell {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    text-align: center;
}

.rule-row.highlight .rule-cell {
    background: #fef3c7;
    border-left: 3px solid var(--warning-color);
}

.rule-cell {
    padding: 12px 15px;
    background: white;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.rule-cell:last-child {
    justify-content: center;
    font-weight: bold;
}

.points-zero {
    color: var(--success-color);
}

.points-low {
    color: #f59e0b;
}

.points-medium {
    color: #ef4444;
}

.points-high {
    color: #dc2626;
}

.points-extra {
    color: var(--warning-color);
}

.rules-notes {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.rules-notes h4 {
    margin: 0 0 15px 0;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.rules-notes ul {
    margin: 0;
    padding-left: 20px;
}

.rules-notes li {
    margin-bottom: 8px;
    color: #475569;
    line-height: 1.5;
}

/* Últimos Registros */
.registros-list {
    min-height: 200px;
}

.loading-registros {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #64748b;
}

.loading-registros .loading {
    margin-bottom: 15px;
}

.registro-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.registro-info {
    flex: 1;
}

.registro-nome {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 3px;
}

.registro-detalhes {
    font-size: 0.85rem;
    color: #64748b;
}

.registro-pontos {
    text-align: right;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.registro-tempo {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 5px;
}

/* Responsivo para Admin */
@media (max-width: 768px) {
    .login-card {
        padding: 30px 25px;
        margin: 40px 20px;
    }
    
    .admin-header {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .admin-user {
        width: 100%;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .rules-table {
        grid-template-columns: 1fr;
        gap: 10px;
        background: transparent;
    }
    
    .rule-row {
        display: block;
        margin-bottom: 10px;
    }
    
    .rule-cell {
        border-radius: 6px;
        margin-bottom: 2px;
    }
    
    .rule-row.header {
        display: none;
    }
    
    .registro-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .login-title {
        font-size: 1.5rem;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        justify-content: center;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 10px;
    }
}

/* Animações específicas */
.slide-down {
    animation: slideDown 0.3s ease-out;
}

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

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

/* Estados de validação */
.form-input.error,
.form-select.error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success,
.form-select.success {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

