/* Reset e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #10B981;
    --color-primary-dark: #059669;
    --color-secondary: #A855F7;
    --color-danger: #EF4444;
    --color-warning: #F59E0B;
    --color-info: #3B82F6;
    --color-mint: #D1FAE5;
    --color-white: #FFFFFF;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-300: #D1D5DB;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-gray-900);
    background-color: var(--color-mint);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 100px;
    padding: 1.25rem 1rem; /* reduz a margem interna superior */
    flex: 1 0 auto; /* ocupa o espaço disponível entre header e footer */
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 1rem; /* menos espaço entre logo e conteúdo */
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    padding: 0.5rem 0.75rem; /* moldura menor */
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-primary-dark);
}

/* Imagens responsivas e tamanho da logo */
img { max-width: 100%; height: auto; }
.logo-image {
    width: clamp(180px, 22vw, 20px); /* logo menor em desktops */
    height: auto;
    display: block;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--color-gray-600);
    margin-bottom: 1.5rem;
}

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

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

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background-color: #9333EA;
}

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

.btn-danger:hover {
    background-color: #DC2626;
}

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

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

/* Cards */
.card {
    background: var(--color-white);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.auth-card {
    max-width: 500px;
    margin: 3rem auto;
}

/* Ranking */
.ranking-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--color-white);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

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

.ranking-position {
    flex-shrink: 0;
}

.medal {
    font-size: 2.5rem;
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 0.25rem;
}

.ranking-details {
    font-size: 0.875rem;
    color: var(--color-gray-600);
}

.ranking-points {
    flex-shrink: 0;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--color-white);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.empty-state p {
    color: var(--color-gray-600);
    font-size: 1.125rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--color-gray-300);
    border-radius: 0.5rem;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-white);
    padding: 1.25rem; /* menos preenchimento */
    border-radius: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem; /* menos espaço após header */
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-title h1 {
    font-size: 1.75rem;
    color: var(--color-primary);
}

.dashboard-title p {
    color: var(--color-gray-600);
    font-size: 0.875rem;
}

.dashboard-actions {
    display: flex;
    gap: 1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--color-white);
    padding: 0.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem; /* menos espaço antes do conteúdo */
    overflow-x: auto;
}

.tab {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: var(--color-gray-600);
    border-radius: 0.5rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab:hover {
    background-color: var(--color-gray-100);
}

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

.tab.tab-turmas.active {
    background-color: var(--color-warning);
}

.tab.tab-atividades.active {
    background-color: var(--color-secondary);
}

.tab.tab-registros.active {
    background-color: var(--color-info);
}

.tab.tab-usuarios.active {
    background-color: #EC4899;
}

/* Content */
.content {
    background: var(--color-white);
    padding: 1.25rem; /* reduz padding interno do conteúdo */
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem; /* menos espaço entre título e lista */
}

.content-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

/* List Items */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border: 2px solid var(--color-gray-200);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.list-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.list-item-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 0.25rem;
}

.list-item-info p {
    font-size: 0.875rem;
    color: var(--color-gray-600);
}

.list-item-actions {
    display: flex;
    gap: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-white);
    padding: 2rem;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-gray-600);
}

.modal-close:hover {
    color: var(--color-gray-900);
}

/* Alert */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

.alert-info {
    background-color: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #3B82F6;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .ranking-card {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .dashboard-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .list-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .list-item-actions {
        width: 100%;
        justify-content: center;
    }

    .logo-image {
        width: clamp(140px, 50vw, 260px); /* menor também no mobile */
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.bg-mint {
    background-color: var(--color-mint);
}

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

/* Footer */
.site-footer {
    text-align: center;
    color: var(--color-gray-600);
    padding: 1rem 0;
    margin-top: auto; /* Sticky footer: empurra para base quando há pouco conteúdo */
}

.site-footer a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

