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

:root {
    --primary: #2A5CFF;
    --primary-hover: #1E4DE0;
    --primary-light: #E8EEFF;
    --secondary: #00D9C0;
    --success: #00C48C;
    --error: #FF6B6B;
    --warning: #FFA94D;
    
    --text-primary: #1A1D29;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    
    --border-light: #E5E7EB;
    --border-medium: #D1D5DB;
    
    --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);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
}

h2 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--text-primary);
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Main Content */
.main-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 48px;
    box-shadow: var(--shadow-md);
    max-width: 480px;
    margin: 80px auto;
}

.main-content-wide {
    max-width: 1200px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-medium);
}

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

.btn-success:hover:not(:disabled) {
    background: #00B67A;
    transform: translateY(-1px);
}

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

.btn-danger:hover:not(:disabled) {
    background: #E85555;
}

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

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.15s ease;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

/* Code Input */
.code-input {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Messages */
.message {
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin: 16px 0;
}

.error-message {
    background: #FEE;
    color: var(--error);
    border: 1px solid var(--error);
}

.success-message {
    background: #E6FAF5;
    color: var(--success);
    border: 1px solid var(--success);
}

.info-message {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

/* Grid */
.grid {
    display: grid;
    gap: 24px;
}

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

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

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

@media (max-width: 1024px) {
    .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Event Code Badge */
.event-code-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.5rem;
}

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

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 32px;
}

.dashboard-nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Event Card */
.event-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

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

.event-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.event-card-code {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    letter-spacing: 0.1em;
    margin: 12px 0;
}

.event-card-meta {
    color: var(--text-tertiary);
    font-size: 14px;
    margin-top: 12px;
}

.event-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Wordcloud */
.wordcloud-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 48px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wordcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
}

.word-item {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
}

.table thead th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-light);
}

.table tbody tr {
    border-bottom: 1px solid var(--border-light);
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

/* Status Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #E6FAF5;
    color: var(--success);
}

.badge-error {
    background: #FEE;
    color: var(--error);
}

.badge-warning {
    background: #FFF4E6;
    color: var(--warning);
}

.badge-info {
    background: var(--primary-light);
    color: var(--primary);
}

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

.text-muted {
    color: var(--text-tertiary);
}

.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.p-4 { padding: 16px; }
.p-8 { padding: 32px; }

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .main-content {
        padding: 32px 24px;
        margin: 24px auto;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .modal-content {
        padding: 24px;
    }
    
    .event-card-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Loading */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 64px 24px;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state-description {
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

/* Footer Links */
footer a {
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary) !important;
    text-decoration: underline;
}
