/* ============================================
   FEDERAÇÃO DE ARQUEIROS - STYLESHEET
   ============================================ */

/* CSS Variables */
:root {
    --primary: #2563EB;
    --primary-dark: #1E40AF;
    --success: #16A34A;
    --success-light: #86EFAC;
    --warning: #EAB308;
    --warning-light: #FBBF24;
    --danger: #DC2626;
    --danger-light: #FCA5A5;
    --slate-50: #F8FAFC;
    --slate-100: #F1F5F9;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-900: #0F172A;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    color: var(--slate-900);
    background-color: #F9FAFB;
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInBackground 0.6s ease-out;
}

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

.login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUpIn 0.5s ease-out;
}

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

.logo-section {
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

.logo {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    animation: bounce 0.6s ease-out;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.logo-section h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.logo-section .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.login-content {
    padding: 32px;
}

/* User Type Selector */
.user-type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--slate-200);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-700);
}

.type-btn:hover {
    border-color: var(--primary);
    background: var(--slate-50);
}

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

.type-btn .icon {
    font-size: 24px;
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--slate-900);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

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

/* Demo Box */
.demo-box {
    background: #EBF8FF;
    border: 1px solid #BEE3F8;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 13px;
}

.demo-title {
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: 8px;
}

.demo-list {
    list-style: none;
    space-y: 4px;
}

.demo-list li {
    margin-bottom: 6px;
    color: var(--slate-600);
}

.demo-list code {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    margin-left: 4px;
}

/* ============================================
   BUTTONS
   ============================================ */

button {
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary.btn-large {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
}

.btn-secondary {
    background: var(--slate-200);
    color: var(--slate-900);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--slate-300);
}

.btn-success {
    background: var(--success);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.btn-success:hover {
    background: #15803D;
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.btn-danger:hover {
    background: #B91C1C;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--slate-600);
    padding: 8px;
    border-radius: 8px;
    font-size: 14px;
}

.btn-logout:hover {
    background: var(--slate-100);
    color: var(--slate-900);
}

/* ============================================
   MAIN APPLICATION
   ============================================ */

.main-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(to bottom, var(--slate-50) 0%, white 100%);
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDownIn 0.3s ease-out;
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    font-size: 32px;
}

.header-info h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 4px;
}

.user-info {
    font-size: 13px;
    color: var(--slate-500);
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 0;
}

/* Dashboard */
.dashboard {
    animation: fadeIn 0.4s ease-out;
}

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

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
    color: white;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
}

.welcome-card h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.welcome-card p {
    font-size: 16px;
    opacity: 0.9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

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

.stat-label {
    font-size: 13px;
    color: var(--slate-500);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.stat-value.blue {
    color: #2563EB;
}

.stat-value.green {
    color: #16A34A;
}

.stat-value.yellow {
    color: #EAB308;
}

.stat-value.purple {
    color: #7C3AED;
}

/* ============================================
   CARDS & LISTS
   ============================================ */

.list-card,
.form-card {
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.list-card h3,
.form-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--slate-900);
}

.empty-message {
    text-align: center;
    color: var(--slate-500);
    padding: 40px 20px;
    font-size: 15px;
}

/* Registrations List */
.registrations-list,
.archers-list {
    space-y: 12px;
}

.registration-item,
.archer-item {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.registration-item:hover,
.archer-item:hover {
    background: white;
    border-color: var(--slate-300);
    box-shadow: var(--shadow-sm);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.item-title {
    font-weight: 700;
    color: var(--slate-900);
    font-size: 16px;
    margin-bottom: 4px;
}

.item-subtitle {
    font-size: 13px;
    color: var(--slate-600);
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.pending {
    background: #FEFCE8;
    color: #713F12;
}

.status-badge.approved {
    background: #DCFCE7;
    color: #166534;
}

.status-badge.rejected {
    background: #FEE2E2;
    color: #7F1D1D;
}

.item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.detail {
    color: var(--slate-600);
}

.detail span {
    font-weight: 600;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.item-actions button {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ============================================
   FORMS
   ============================================ */

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.form-actions button {
    flex: 1;
}

/* ============================================
   FEDERATIONS GRID
   ============================================ */

.federations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.federation-card {
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.federation-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.federation-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 8px;
}

.federation-country {
    font-size: 13px;
    color: var(--slate-600);
    margin-bottom: 16px;
}

.federation-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--slate-200);
}

.federation-stat {
    display: flex;
    justify-content: space-between;
}

.federation-stat .label {
    color: var(--slate-600);
}

.federation-stat .value {
    font-weight: 700;
    color: var(--slate-900);
}

.federation-email {
    font-size: 13px;
}

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

.federation-email a:hover {
    text-decoration: underline;
}

/* ============================================
   TABLE
   ============================================ */

.table-responsive {
    overflow-x: auto;
}

.archers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.archers-table thead {
    background: var(--slate-50);
    border-bottom: 2px solid var(--slate-200);
}

.archers-table th {
    padding: 12px;
    text-align: left;
    font-weight: 700;
    color: var(--slate-900);
}

.archers-table td {
    padding: 12px;
    border-bottom: 1px solid var(--slate-200);
}

.archers-table tbody tr:hover {
    background: var(--slate-50);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: white;
    border-top: 1px solid var(--slate-200);
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
    color: var(--slate-600);
    font-size: 14px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .user-type-selector {
        grid-template-columns: 1fr;
    }

    .type-btn {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
    }

    .type-btn .icon {
        font-size: 20px;
    }

    .header-info h1 {
        font-size: 16px;
    }

    .welcome-card {
        padding: 24px;
    }

    .welcome-card h2 {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 28px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .item-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .item-actions {
        flex-direction: column;
    }

    .federations-grid {
        grid-template-columns: 1fr;
    }

    .archers-table {
        font-size: 12px;
    }

    .archers-table th,
    .archers-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .login-card {
        border-radius: 12px;
    }

    .logo-section {
        padding: 30px 20px;
    }

    .logo {
        font-size: 40px;
    }

    .logo-section h1 {
        font-size: 20px;
    }

    .login-content {
        padding: 24px;
    }

    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .header-left {
        flex-direction: column;
    }

    .welcome-card {
        padding: 20px;
    }

    .welcome-card h2 {
        font-size: 18px;
    }

    .welcome-card p {
        font-size: 14px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 24px;
    }

    .list-card,
    .form-card {
        padding: 16px;
    }

    .item-details {
        grid-template-columns: 1fr;
    }

    .demo-box {
        font-size: 12px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

.gap-2 {
    gap: 8px;
}

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

::-webkit-scrollbar-track {
    background: var(--slate-100);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-500);
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    animation: fadeIn 0.3s ease-out;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    animation: slideUpIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90vw;
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--slate-900);
}

.modal-content p {
    color: var(--slate-600);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions button {
    flex: 1;
}

.modal-actions .btn-secondary {
    background: var(--slate-200);
    color: var(--slate-900);
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}
