/* CSS Variables */
:root {
    --primary: #0BC5EA;
    --primary-dark: #0891B2;
    --secondary: #F59E0B;
    --success: #10B981;
    --danger: #EF4444;
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-card: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --border: #475569;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Navbar */
.navbar {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px var(--shadow);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

.nav-brand h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(11, 197, 234, 0.1);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(11, 197, 234, 0.15);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

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

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Forms Grid */
.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Form Card */
.form-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 8px 24px var(--shadow);
    transition: all 0.3s ease;
}

.form-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(11, 197, 234, 0.2);
    border-color: var(--primary);
}

.form-header {
    margin-bottom: 2rem;
    text-align: center;
}

.form-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.form-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.field-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    font-style: italic;
    opacity: 0.8;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    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(11, 197, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.checkbox-label:hover {
    border-color: rgba(11, 197, 234, 0.5);
    background: rgba(11, 197, 234, 0.08);
    transform: translateX(4px);
}

.checkbox-label:hover::before {
    left: 100%;
}

.hidden-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-label:has(input:checked) {
    background: rgba(11, 197, 234, 0.15);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(11, 197, 234, 0.2);
}

.checkbox-label:has(input:checked) .checkbox-text {
    color: var(--primary);
    font-weight: 700;
}

.checkbox-text {
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.2;
}

.players-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.players-section h4 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.section-note {
    background: rgba(11, 197, 234, 0.1);
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.player-group {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.player-group:hover {
    border-color: var(--primary);
    background: rgba(11, 197, 234, 0.05);
    transform: translateX(4px);
}

.player-group-header {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-group .form-group {
    margin-bottom: 0.75rem;
}

.player-group .form-group:last-child {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0891B2 50%, var(--primary-dark) 100%);
    background-size: 200% 200%;
    color: white;
    border: 2px solid transparent;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 30px rgba(11, 197, 234, 0.5),
        0 0 20px rgba(11, 197, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 6px 20px rgba(11, 197, 234, 0.4);
}

.btn span {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.registration-form .btn {
    margin: 0 auto;
    display: block;
    min-width: 300px;
}

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

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.stat-badge {
    background: linear-gradient(135deg, rgba(11, 197, 234, 0.15) 0%, rgba(11, 197, 234, 0.05) 100%);
    border: 2px solid rgba(11, 197, 234, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(11, 197, 234, 0.1);
    transition: all 0.3s ease;
}

.stat-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(11, 197, 234, 0.2);
    border-color: var(--primary);
}

.stat-badge strong {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(11, 197, 234, 0.5);
}

/* Teams Grid */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.team-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease-out;
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(11, 197, 234, 0.2);
    border-color: var(--primary);
}

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

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.team-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.team-tag {
    background: var(--primary);
    color: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
}

.team-captain {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(11, 197, 234, 0.1);
    border-radius: 0.5rem;
}

.team-captain strong {
    color: var(--primary);
}

.team-players {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.team-players h4 {
    font-size: 0.875rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.player-item:hover {
    background: rgba(11, 197, 234, 0.08);
    border-color: rgba(11, 197, 234, 0.3);
    transform: translateX(4px);
}

.player-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.player-nick {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.player-name {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    margin-top: 0.15rem;
}

.role-badge {
    background: var(--bg-card);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    min-width: 60px;
    text-align: center;
}

/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.agent-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease-out;
}

.agent-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(11, 197, 234, 0.2);
    border-color: var(--primary);
}

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

.agent-nick {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.rank-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.rank-Iron, .rank-Bronze { background: #CD7F32; color: white; }
.rank-Silver { background: #C0C0C0; color: #1E293B; }
.rank-Gold { background: #FFD700; color: #1E293B; }
.rank-Platinum { background: #4A9B8E; color: white; }
.rank-Emerald { background: #50C878; color: white; }
.rank-Diamond { background: #B9F2FF; color: #1E293B; }
.rank-Master { background: #9D4EDD; color: white; }
.rank-Grandmaster { background: #EF4444; color: white; }
.rank-Challenger { background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%); color: white; }

.agent-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 80px;
}

.info-value {
    color: var(--text-primary);
}

.agent-description {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Custom Select */
.custom-select {
    position: relative;
    width: auto;
    min-width: 220px;
    user-select: none;
}

.select-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.select-icon {
    font-size: 1.2rem;
}

.select-text {
    flex: 1;
}

.select-arrow {
    color: var(--primary);
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.custom-select.open .select-arrow {
    transform: rotate(180deg);
}

.select-trigger:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(11, 197, 234, 0.1) 0%, rgba(30, 41, 59, 0.9) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(11, 197, 234, 0.3);
}

.custom-select.open .select-trigger {
    border-color: var(--primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 0 0 4px rgba(11, 197, 234, 0.2);
}

/* Dropdown */
.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.98);
    border: 2px solid var(--primary);
    border-top: none;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.custom-select.open .select-dropdown {
    max-height: 300px;
    opacity: 1;
    overflow-y: auto;
}

/* Custom Scrollbar */
.select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.select-dropdown::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0 0 1rem 0;
}

.select-dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary) 0%, rgba(11, 197, 234, 0.6) 100%);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.select-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    box-shadow: 0 0 8px rgba(11, 197, 234, 0.6);
}

/* Firefox */
.select-dropdown {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(15, 23, 42, 0.5);
}

.select-option {
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.select-option:last-child {
    border-bottom: none;
}

.select-option:hover {
    background: rgba(11, 197, 234, 0.15);
    color: var(--primary);
    padding-left: 1.5rem;
}

.select-option.active {
    background: rgba(11, 197, 234, 0.2);
    color: var(--primary);
    font-weight: 700;
}

.select-option.active::before {
    content: '✓ ';
    margin-right: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    display: none;
}

.empty-state.show {
    display: block;
}

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

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
}

.modal-content {
    position: relative;
    z-index: 10000;
    background: rgba(30, 41, 59, 0.98);
    border: 2px solid rgba(11, 197, 234, 0.3);
    border-radius: 1.5rem;
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.2s ease;
    will-change: transform;
}

.modal.active .modal-content {
    transform: scale(1);
}

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

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.warning-modal h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 800;
}

.warning-text {
    font-size: 1.125rem;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.warning-subtext {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-actions .btn {
    min-width: 140px;
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.8) 0%, rgba(51, 65, 85, 0.9) 100%);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(71, 85, 105, 1) 0%, rgba(51, 65, 85, 1) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--primary);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 24px var(--shadow);
    transform: translateX(500px);
    transition: transform 0.3s ease;
    z-index: 2000;
    max-width: 350px;
    font-size: 0.9rem;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

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

    .teams-grid,
    .agents-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: space-around;
    }

    .form-card {
        padding: 1.5rem;
    }

    .team-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
