/* Election Commission Portal - Custom Styles */
/* Beautiful, Modern, Mobile-Responsive Design */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #1a237e 0%, #0d47a1 50%, #01579b 100%);
    --sec-color: #1565c0;
    --district-color: #2e7d32;
    --urban-color: #6a1b9a;
    --block-color: #d84315;
    --gold-accent: #ffc107;
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --text-dark: #1a1a2e;
    --text-light: #6c757d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif;
    min-height: 100vh;
    background: var(--primary-gradient);
    overflow-x: hidden;
}

/* Animated Background Pattern */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 193, 7, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 40% 40%, rgba(0, 150, 136, 0.1) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

.bg-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

/* Floating Elements Animation */
.floating-element {
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: float 20s infinite ease-in-out;
    pointer-events: none;
}

.floating-element:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 50%;
    right: -50px;
    animation-delay: -5s;
}

.floating-element:nth-child(3) {
    width: 150px;
    height: 150px;
    bottom: -50px;
    left: 30%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(5deg);
    }
    66% {
        transform: translateY(20px) rotate(-5deg);
    }
}

/* Main Container */
.main-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Header Section */
.portal-header {
    text-align: center;
    padding: 40px 20px;
    color: white;
    animation: fadeInDown 0.8s ease-out;
}

.portal-header .emblem {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(255, 193, 7, 0.4);
    animation: pulse 2s infinite;
    padding: 10px;
    overflow: hidden;
}

.portal-header .emblem .logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(255, 193, 7, 0.4);
    }
    50% {
        box-shadow: 0 10px 60px rgba(255, 193, 7, 0.6);
    }
}

.portal-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

.portal-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Login Cards Grid */
.login-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* Individual Login Card */
.login-card {
    background: var(--glass-bg);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 24px 24px 0 0;
}

.login-card.sec-card::before {
    background: linear-gradient(90deg, #1565c0, #1976d2);
}

.login-card.district-card::before {
    background: linear-gradient(90deg, #2e7d32, #43a047);
}

.login-card.urban-card::before {
    background: linear-gradient(90deg, #6a1b9a, #8e24aa);
}

.login-card.block-card::before {
    background: linear-gradient(90deg, #d84315, #f4511e);
}

.login-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.login-card .icon-wrapper {
    width: 90px;
    height: 90px;
    margin: 0 auto 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    transition: all 0.4s ease;
    position: relative;
}

.login-card.sec-card .icon-wrapper {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: var(--sec-color);
}

.login-card.district-card .icon-wrapper {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: var(--district-color);
}

.login-card.urban-card .icon-wrapper {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    color: var(--urban-color);
}

.login-card.block-card .icon-wrapper {
    background: linear-gradient(135deg, #fbe9e7, #ffccbc);
    color: var(--block-color);
}

.login-card:hover .icon-wrapper {
    transform: scale(1.1) rotate(10deg);
}

.login-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.login-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.login-btn {
    display: inline-block;
    padding: 14px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-card.sec-card .login-btn {
    background: linear-gradient(135deg, #1565c0, #1976d2);
}

.login-card.district-card .login-btn {
    background: linear-gradient(135deg, #2e7d32, #43a047);
}

.login-card.urban-card .login-btn {
    background: linear-gradient(135deg, #6a1b9a, #8e24aa);
}

.login-card.block-card .login-btn {
    background: linear-gradient(135deg, #d84315, #f4511e);
}

.login-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-btn::after {
    content: '→';
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.login-btn:hover::after {
    transform: translateX(5px);
}

/* Login Form Page Styles */
.login-page-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-form-card {
    background: var(--glass-bg);
    border-radius: 30px;
    padding: 50px 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--card-shadow);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.login-form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
}

.login-form-card.sec-form::before {
    background: linear-gradient(90deg, #1565c0, #42a5f5);
}

.login-form-card.district-form::before {
    background: linear-gradient(90deg, #2e7d32, #66bb6a);
}

.login-form-card.urban-form::before {
    background: linear-gradient(90deg, #6a1b9a, #ab47bc);
}

.login-form-card.block-form::before {
    background: linear-gradient(90deg, #d84315, #ff7043);
}

.login-form-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-form-header .form-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    overflow: hidden;
    background: white;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.login-form-header .form-icon .form-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sec-form .form-icon {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: var(--sec-color);
}

.district-form .form-icon {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: var(--district-color);
}

.urban-form .form-icon {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    color: var(--urban-color);
}

.block-form .form-icon {
    background: linear-gradient(135deg, #fbe9e7, #ffccbc);
    color: var(--block-color);
}

.login-form-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-form-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Form Input Styles */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 14px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: var(--sec-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.1);
}

.form-group .input-icon {
    position: absolute;
    right: 18px;
    top: 50px;
    color: var(--text-light);
    font-size: 1.2rem;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    font-family: 'Poppins', sans-serif;
}

.sec-form .submit-btn {
    background: linear-gradient(135deg, #1565c0, #1976d2);
}

.district-form .submit-btn {
    background: linear-gradient(135deg, #2e7d32, #43a047);
}

.urban-form .submit-btn {
    background: linear-gradient(135deg, #6a1b9a, #8e24aa);
}

.block-form .submit-btn {
    background: linear-gradient(135deg, #d84315, #f4511e);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 25px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--text-dark);
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Dashboard/Home Page Styles */
.dashboard-container {
    min-height: 100vh;
    background: #f5f7fa;
}

.dashboard-navbar {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-brand .brand-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    overflow: hidden;
    background: white;
    padding: 5px;
}

.navbar-brand .brand-icon .navbar-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sec-dashboard .navbar-brand .brand-icon {
    background: linear-gradient(135deg, #1565c0, #1976d2);
}

.district-dashboard .navbar-brand .brand-icon {
    background: linear-gradient(135deg, #2e7d32, #43a047);
}

.urban-dashboard .navbar-brand .brand-icon {
    background: linear-gradient(135deg, #6a1b9a, #8e24aa);
}

.block-dashboard .navbar-brand .brand-icon {
    background: linear-gradient(135deg, #d84315, #f4511e);
}

.navbar-brand h1 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f4f8;
    padding: 10px 20px;
    border-radius: 50px;
}

.user-badge .avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-badge span {
    font-weight: 500;
    color: var(--text-dark);
}

.logout-btn {
    padding: 10px 25px;
    background: #ef5350;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}

.logout-btn:hover {
    background: #e53935;
    transform: translateY(-2px);
}

/* Dashboard Content */
.dashboard-content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.welcome-banner {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    opacity: 0.1;
}

.sec-dashboard .welcome-banner::before {
    background: linear-gradient(135deg, #1565c0, #42a5f5);
}

.district-dashboard .welcome-banner::before {
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
}

.urban-dashboard .welcome-banner::before {
    background: linear-gradient(135deg, #6a1b9a, #ab47bc);
}

.block-dashboard .welcome-banner::before {
    background: linear-gradient(135deg, #d84315, #ff7043);
}

.welcome-banner h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.welcome-banner p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.welcome-banner .user-id-display {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
}

.sec-dashboard .user-id-display {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: var(--sec-color);
}

.district-dashboard .user-id-display {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: var(--district-color);
}

.urban-dashboard .user-id-display {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    color: var(--urban-color);
}

.block-dashboard .user-id-display {
    background: linear-gradient(135deg, #fbe9e7, #ffccbc);
    color: var(--block-color);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
}

.stat-card.blue .stat-icon {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
}

.stat-card.green .stat-icon {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
}

.stat-card.purple .stat-icon {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    color: #6a1b9a;
}

.stat-card.orange .stat-icon {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #e65100;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Quick Actions */
.quick-actions {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.quick-actions h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 25px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.action-btn:hover {
    background: white;
    border-color: #e0e0e0;
    transform: translateX(5px);
}

.action-btn .action-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.action-btn span {
    font-weight: 500;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.portal-footer {
    text-align: center;
    padding: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .portal-header h1 {
        font-size: 1.8rem;
    }
    
    .portal-header p {
        font-size: 1rem;
    }
    
    .login-cards-container {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .login-card {
        padding: 30px 25px;
    }
    
    .login-form-card {
        padding: 40px 25px;
        margin: 10px;
    }
    
    .dashboard-navbar {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }
    
    .navbar-brand h1 {
        font-size: 1.1rem;
    }
    
    .user-info {
        flex-direction: column;
        width: 100%;
    }
    
    .user-badge {
        width: 100%;
        justify-content: center;
    }
    
    .logout-btn {
        width: 100%;
        text-align: center;
    }
    
    .dashboard-content {
        padding: 15px;
    }
    
    .welcome-banner {
        padding: 25px;
    }
    
    .welcome-banner h2 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .portal-header .emblem {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }
    
    .portal-header h1 {
        font-size: 1.5rem;
    }
    
    .login-card .icon-wrapper {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }
    
    .login-form-header .form-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .login-form-header h2 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .bg-pattern,
    .floating-element,
    .logout-btn {
        display: none;
    }
    
    body {
        background: white;
    }
}

