/* Modern Professional Design System for E-Voting System */

/* CSS Variables - Modern Color Palette */
:root {
    /* Primary Colors */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0284c7;
    --primary-800: #0143a3;
    --primary-900: #0c4a6e;
    
    /* Secondary Colors */
    --secondary-500: #64748b;
    --secondary-600: #475569;
    
    /* Status Colors */
    --success-500: #22c55e;
    --success-600: #16a34a;
    --danger-500: #f87171;
    --danger-600: #dc2626;
    --warning-500: #f59e0b;
    --info-500: #3b82f6;
    
    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* 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), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
}

/* Base Styles */
body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--gray-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

/* Modern Buttons */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease-in-out;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

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

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.125rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-600), #15803d);
    color: white;
}

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

.btn-outline-primary:hover {
    background: var(--primary-50);
    color: var(--primary-700);
    border-color: var(--primary-600);
}

/* Modern Cards */
.card {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
}

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

.card-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    background: white;
    font-weight: 600;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700)) !important;
    color: white;
    border: none;
}

.card-body {
    padding: 1.5rem;
}

/* Modern Forms */
.form-control, .form-select {
    border-radius: var(--radius-md);
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-300);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.input-group-text {
    border-radius: var(--radius-md);
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
}

/* Modern Alerts */
.alert {
    border-radius: var(--radius-lg);
    border: none;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

/* Modern Badges */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
}

/* Modern Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: var(--primary-50);
}

/* Modern Navbar */
.navbar {
    box-shadow: var(--shadow-md);
    padding: 0.75rem 0;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gray-900) !important;
}

.navbar .nav-link {
    color: var(--gray-700) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.navbar .nav-link:hover, .navbar .nav-link.active {
    background: var(--primary-50);
    color: var(--primary-700) !important;
}

/* Modern Progress Bars */
.progress {
    border-radius: var(--radius-full);
    height: 0.75rem;
    background: var(--gray-200);
}

.progress-bar {
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Utility Classes */
.text-primary { color: var(--primary-600) !important; }
.text-success { color: var(--success-600) !important; }
.text-danger { color: var(--danger-600) !important; }
.text-warning { color: var(--warning-500) !important; }
.text-info { color: var(--info-500) !important; }

.bg-primary-light { background-color: var(--primary-100) !important; }
.bg-success-light { background-color: #dcfce7 !important; }
.bg-danger-light { background-color: #fee2e2 !important; }
.bg-warning-light { background-color: #fef3c7 !important; }
.bg-info-light { background-color: #dbeafe !important; }

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

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

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

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

/* Mobile Responsive Design */
@media (max-width: 1199.98px) {
    .container {
        max-width: 100%;
    }
}

@media (max-width: 991.98px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.125rem; }
    h6 { font-size: 1rem; }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .navbar .nav-link {
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 767.98px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.875rem; }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card {
        border-radius: var(--radius-lg);
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.125rem;
    }
    
    .navbar .nav-link {
        padding: 0.5rem;
        text-align: center;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .form-control, .form-select {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 575.98px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.375rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.875rem; }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .card-body {
        padding: 0.875rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
        width: 100%;
    }
    
    .table-responsive-stack thead {
        display: none;
    }
    
    .table-responsive-stack tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-lg);
        padding: 0.75rem;
        background: white;
    }
    
    .table-responsive-stack tbody td {
        display: block;
        text-align: right;
        padding: 0.375rem 0.5rem;
        border: none;
    }
    
    .table-responsive-stack tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: var(--gray-600);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .candidate-card-simple:hover {
        transform: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-600: #0066cc;
        --primary-700: #0052a3;
    }
    
    .card {
        border: 2px solid var(--gray-400);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}