:root {
    --primary: #0f172a;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --bg: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text: #0f172a;
    --text-muted: #475569;
    --error: #e11d48;
    --success: #059669;
    --border: rgba(226, 232, 240, 0.8);
    --radius: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at top right, #e2e8f0, #f8fafc);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Auth Pages */
.auth-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header h1 {
    font-size: 2.25rem;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: -0.025em;
}

.auth-header p {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 1.125rem;
}

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

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

.form-control {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    background: white;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    width: 100%;
    font-size: 1rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

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

/* Dashboard Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    padding: 1.25rem 2.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

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

.country-card {
    background: white;
    border-radius: 20px;
    padding: 1.75rem;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.country-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.flag-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
}

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

/* Submissions Table */
.table-container {
    background: white;
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

td {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.9375rem;
}

.status-badge {
    padding: 0.375rem 1rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

.status-pending { background: #fffbeb; color: #92400e; border: 1px solid #fef3c7; }
.status-approved { background: #f0fdf4; color: #166534; border: 1px solid #dcfce7; }
.status-rejected { background: #fff1f2; color: #991b1b; border: 1px solid #fee2e2; }

/* Responsive */
@media (max-width: 640px) {
    .auth-card {
        padding: 2rem;
    }
    .navbar {
        padding: 1rem 1.5rem;
    }
}

/* Admin Layout */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
}

.sidebar {
    width: var(--sidebar-width, 260px);
    background: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    transition: all 0.3s;
}

.sidebar.collapsed .sidebar-brand {
    padding: 1.5rem 0.5rem;
}

.sidebar-brand img {
    height: 40px;
    object-fit: contain;
    transition: all 0.3s;
}

.sidebar.collapsed .sidebar-brand img {
    height: 30px;
}

.sidebar-menu {
    padding: 1.5rem 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed .sidebar-menu {
    padding: 1.5rem 0.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 0.875rem;
    gap: 0;
}

.menu-item span {
    transition: opacity 0.3s, width 0.3s;
}

.sidebar.collapsed .menu-item span {
    opacity: 0;
    width: 0;
    display: none;
}

.sidebar.collapsed .lang-selector {
    display: none;
}

.menu-item:hover, .menu-item.active {
    background: #1e293b;
    color: white;
}

.menu-item.active {
    background: #4f46e5;
}

.main-content {
    margin-left: var(--sidebar-width, 260px);
    flex-grow: 1;
    padding: 2.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100% - var(--sidebar-width, 260px));
}

.sidebar.collapsed + .main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
}

.sidebar-toggle {
    position: absolute;
    right: -15px;
    top: 25px;
    width: 30px;
    height: 30px;
    background: #4f46e5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
    color: white;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.sidebar-toggle:hover {
    background: #4338ca;
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-toggle:hover {
    transform: rotate(180deg) scale(1.1);
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        width: 260px;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}
