@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* === 1. CSS Reset & Global Variables === */
:root {
    --primary: #4361ee;
    --primary-hover: #3a0ca3;
    --secondary: #4cc9f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    --border-light: #e2e8f0;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 9999px;
    
    --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-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-primary: 'Inter', sans-serif;
}

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

/* === 2. Global Typography & Body === */
body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* === 3. Premium Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: var(--text-light);
    box-shadow: 0 4px 14px 0 rgba(67, 97, 238, 0.39);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.23);
    transform: translateY(-2px);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
}
.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.23);
    transform: translateY(-2px);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.39);
}
.btn-warning:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.23);
    transform: translateY(-2px);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.39);
}
.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.23);
    transform: translateY(-2px);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, var(--info), #2563eb);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}
.btn-info:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.23);
    transform: translateY(-2px);
    color: white;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border-light);
}
.btn-secondary:hover {
    background-color: #e2e8f0;
    transform: translateY(-2px);
}

.btn-link {
    background: transparent;
    color: var(--primary);
    box-shadow: none;
    padding: 0;
}
.btn-link:hover {
    text-decoration: underline;
    transform: none;
}

/* === 4. Modern Forms === */
.form-group {
    margin-bottom: 1.2rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    color: var(--text-main);
    background-color: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.form-control:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.form-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .form-grid .full-width {
        grid-column: 1 / -1;
    }
}

/* === 5. Premium Alerts/Messages === */
.message {
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.4s ease-out forwards;
}

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

.message.success {
    background-color: #ecfdf5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.message.error {
    background-color: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.message.info {
    background-color: #eff6ff;
    color: #1e40af;
    border-left: 4px solid var(--info);
}

/* === 6. Glassmorphism Auth Container === */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.4) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    filter: blur(40px);
    z-index: 0;
}

.auth-container::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(76, 201, 240, 0.4) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    filter: blur(40px);
    z-index: 0;
}

.auth-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    text-align: center;
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card h2 {
    color: var(--text-main);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card .form-group {
    text-align: left;
}

.auth-card button[type="submit"] {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.8rem;
    font-size: 1rem;
}

.auth-card .bottom-link {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* === 7. Modern Tables (reusables) === */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: white;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

table th, table td {
    padding: 1rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    font-size: 0.9rem;
}

table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

table tbody tr {
    transition: var(--transition);
}

table tbody tr:hover {
    background-color: #f1f5f9;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* --- Login Page Styles --- */
.login-page {
    background: linear-gradient(135deg, #f0f4f8, #d9e2ec);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
}

.login-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-header h2 {
    color: var(--text-dark);
    margin-bottom: 0.2rem;
}

.login-header p {
    color: var(--text-muted);
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
}

.login-form label i {
    width: 20px;
    color: var(--primary-color);
}

.login-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background-color: #f8fafc;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: #fff;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.login-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.message.error {
    background-color: #fef2f2;
    color: #ef4444;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #fecaca;
}