/* ===================================
   Modern CSS Variables
   =================================== */
:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    /* Secondary Colors */
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Neutral Colors */
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --gray-light: #cbd5e1;
    --gray-lighter: #f1f5f9;
    --white: #ffffff;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    
    /* Shadows */
    --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);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   Reset and Base Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   Layout Components
   =================================== */
.container {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

/* ===================================
   Header Styles
   =================================== */
.site-header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 20px 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
}

.header-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.header-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    animation: float-header 15s infinite ease-in-out;
}

.header-shape-1 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.header-shape-2 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    top: -30px;
    right: 10%;
    animation-delay: 3s;
}

.header-shape-3 {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    bottom: -40px;
    right: -40px;
    animation-delay: 6s;
}

@keyframes float-header {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(20px, -20px) scale(1.1);
    }
    66% {
        transform: translate(-15px, 15px) scale(0.9);
    }
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    z-index: 10;
}

.branding {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    font-size: 3rem;
    animation: bounce-icon 3s infinite ease-in-out;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

@keyframes bounce-icon {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(-5deg);
    }
    75% {
        transform: translateY(-5px) rotate(5deg);
    }
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logo sup {
    font-size: 0.5em;
    font-weight: 600;
}

.tagline {
    font-size: 0.875rem;
    opacity: 0.95;
    font-weight: 500;
}

.language-selector {
    margin-left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 10;
}

.language-icon {
    font-size: 1.5rem;
    animation: spin-slow 20s linear infinite;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.language-dropdown {
    padding: 10px 16px;
    font-size: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.language-dropdown:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.language-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.language-dropdown option {
    background: var(--dark);
    color: var(--white);
}

/* ===================================
   Card Styles
   =================================== */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    margin-bottom: 24px;
    transition: var(--transition);
    border: 1px solid var(--gray-lighter);
}

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

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-lighter);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 6px;
}

.card-subtitle {
    font-size: 0.9375rem;
    color: var(--gray);
    font-weight: 500;
}

.card-body {
    margin-bottom: 20px;
}

.card-footer {
    padding-top: 16px;
    border-top: 2px solid var(--gray-lighter);
}

/* ===================================
   Form Styles
   =================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.875rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.9375rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--dark);
    transition: var(--transition);
    font-family: inherit;
}

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

.form-input.error {
    border-color: var(--error);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
    display: block;
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--error);
    font-weight: 500;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--gray);
}

/* Icon Sizes */
.icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-md {
    width: 24px;
    height: 24px;
}

.icon-lg {
    width: 48px;
    height: 48px;
}

.icon-xl {
    width: 64px;
    height: 64px;
}

/* ===================================
   Button Styles
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

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

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

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

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

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

.btn-ghost {
    background: transparent;
    color: var(--gray);
}

.btn-ghost:hover {
    background: var(--gray-lighter);
    color: var(--dark);
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.0625rem;
    min-height: 52px;
}

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

.btn-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===================================
   Alert Styles
   =================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

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

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

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

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 2px solid #3b82f6;
}

/* ===================================
   Game Card Styles
   =================================== */
.game-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient-primary);
}

.game-card.imposter {
    background: var(--gradient-secondary);
    color: var(--white);
}

/* REMOVED: Security fix - Köstebek cards should be visually identical to normal cards
   This styling was leaking role information to players
.game-card.kostebek {
    background: var(--gradient-accent);
    color: var(--dark);
}
*/

.card-role {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 24px;
    opacity: 0.8;
}

.card-word {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 32px;
    letter-spacing: -1px;
}

.card-icon {
    font-size: 5rem;
    margin-bottom: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===================================
   Player Selection Styles
   =================================== */
.player-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.player-option {
    padding: 20px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
    font-weight: 600;
}

.player-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--white);
    transform: translateY(-2px);
}

.player-option.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

/* ===================================
   Info Section Styles
   =================================== */
.info-section {
    background: var(--gray-lighter);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 24px 0;
}

.info-item {
    margin-bottom: 12px;
    font-size: 1rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item strong {
    color: var(--dark);
    font-weight: 700;
}

/* ===================================
   Link Styles
   =================================== */
.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

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

/* ===================================
   Utility Classes
   =================================== */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .card {
        padding: 24px;
    }
    
    .card-title {
        font-size: 1.375rem;
    }
    
    .game-card {
        padding: 32px 24px;
        min-height: 350px;
    }
    
    .card-word {
        font-size: 2.5rem;
    }
    
    .card-icon {
        font-size: 4rem;
    }
    
    .player-selector {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .btn {
        padding: 11px 20px;
        font-size: 0.875rem;
    }
    
    .btn-large {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    .form-input,
    .form-select {
        padding: 11px 12px;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .site-header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .language-selector {
        margin-left: 0;
        margin-top: 12px;
    }
    
    .card {
        padding: 20px;
        margin: 20px auto;
    }
    
    .card-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .card-subtitle {
        font-size: 0.875rem;
    }
    
    .game-card {
        padding: 24px 16px;
    }
    
    .card-word {
        font-size: 2rem;
    }
    
    .icon-lg {
        width: 40px;
        height: 40px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
}

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

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

/* ===================================
   Transition Screen
   =================================== */
.transition-screen {
    background: var(--gradient-primary);
    color: var(--white);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
}

.transition-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.transition-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 32px;
}

/* ===================================
   Footer Styles
   =================================== */
.site-footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: var(--white);
    padding: 40px 0 30px;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

.footer-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
}

.footer-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.footer-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.2;
    animation: float-footer 20s infinite ease-in-out;
}

.footer-shape-1 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    bottom: -80px;
    left: -80px;
    animation-delay: 0s;
}

.footer-shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    top: -60px;
    right: -60px;
    animation-delay: 5s;
}

@keyframes float-footer {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

.site-footer .container {
    position: relative;
    z-index: 10;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-icon {
    font-size: 3rem;
    animation: pulse-footer 3s infinite ease-in-out;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes pulse-footer {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.footer-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.footer-logo sup {
    font-size: 0.5em;
    font-weight: 600;
}

.footer-tagline {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
}

.footer-info {
    opacity: 0.8;
    font-size: 0.875rem;
    line-height: 1.8;
}

.footer-info p {
    margin: 4px 0;
}

/* Footer Responsive */
@media (max-width: 480px) {
    .site-footer {
        padding: 30px 0 20px;
        margin-top: 40px;
    }
    
    .footer-brand {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-icon {
        font-size: 2.5rem;
    }
    
    .footer-logo {
        font-size: 1.25rem;
    }
}
