/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

/* Login Page Styles */
.login-container {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
}

.image-section {
    flex: 0 0 80%;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f97316; /* Fallback color if image fails to load */
    transition: background-image 0.5s ease-in-out;
}

.image-section.loading {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.image-section.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 5;
}

@keyframes loading-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.login-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(249, 115, 22, 0.0), rgba(234, 88, 12, 0.0));
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-content {
    text-align: center;
    color: white;
}

.image-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.image-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.form-section {
    flex: 0 0 20%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
}

.form-container {
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2.5rem;
    color: #f97316;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #6b7280;
    font-size: 1rem;
}

/* Form Styles */
.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-group label i {
    margin-right: 0.5rem;
    color: #6b7280;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #f97316, #f97316);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.3);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* Demo Credentials */
.demo-credentials {
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.demo-credentials h4 {
    color: #374151;
    margin-bottom: 0.5rem;
}

.demo-credentials p {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background-color: #f8fafc;
}

.dashboard-header {
    background: linear-gradient(135deg, #f97316, #f97316);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-text {
    font-weight: 500;
}

.user-role {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.2);
}

.user-role.admin {
    background-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Dashboard Main */
.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-header h3 {
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
}

.card-content {
    padding: 1.5rem;
}

.card-content p {
    margin-bottom: 0.5rem;
    color: #6b7280;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f97316, #f97316);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.action-btn.admin {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.admin-only {
    border: 2px solid #fbbf24;
}

.admin-only .card-header {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

/* Page Container */
.page-container {
    min-height: 100vh;
    background-color: #f8fafc;
}

.page-header {
    background: linear-gradient(135deg, #f97316, #f97316);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.admin-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-content-full {
    max-width: 95%;
    margin: 0 auto;
    padding: 1rem;
}

.content-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.info-box {
    background-color: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid #f97316;
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    padding: 0.25rem 0;
    color: #374151;
}

.admin-notice, .user-notice {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.admin-notice {
    background-color: #fffbeb;
    border: 1px solid #fbbf24;
    color: #92400e;
}

.user-notice {
    background-color: #f0f9ff;
    border: 1px solid #38bdf8;
    color: #0c4a6e;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #f97316, #f97316);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.btn-admin {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.btn-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Admin Panel Specific */
.admin-section h2 {
    color: #374151;
    margin-bottom: 1rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: #374151;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Users Table */
.users-table-section {
    margin: 2rem 0;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.users-table th,
.users-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.users-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-badge.admin {
    background-color: #fbbf24;
    color: white;
}

.role-badge.user {
    background-color: #6b7280;
    color: white;
}

/* Admin Actions */
.admin-actions {
    margin: 2rem 0;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.admin-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.admin-action-btn:hover {
    border-color: #f59e0b;
    background-color: #fffbeb;
    transform: translateY(-2px);
}

.admin-action-btn i {
    font-size: 2rem;
    color: #f59e0b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .image-section,
    .form-section {
        flex: 1 1 auto;
        width: 100%;
    }
    
    .image-section {
        min-height: 40vh;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .users-table {
        font-size: 0.875rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.5rem;
    }
}
