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

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #1a1f3a;
    --bg-tertiary: #252b47;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.3);
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(102, 126, 234, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(118, 75, 162, 0.15) 0px, transparent 50%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: var(--text-primary);
}

.container, .login-container, .admin-container {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    padding: 3rem 4rem;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow), var(--shadow-glow);
    animation: fadeIn 0.8s ease-in;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.admin-container {
    max-width: 1200px;
    width: 100%;
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

h1 {
    font-size: 2.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.admin-container h1 {
    font-size: 2.5rem;
    text-align: left;
}

.clock {
    margin: 2rem 0;
    padding: 2.5rem;
    background: var(--accent-gradient);
    border-radius: 20px;
    color: white;
    box-shadow: var(--shadow-glow), 0 10px 40px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.clock::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

.clock-time {
    font-size: 3.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.clock-date {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.user-menu {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.user-menu a {
    color: var(--accent-primary);
    text-decoration: none;
    margin: 0 0.75rem;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: inline-block;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.user-menu a:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.user-info {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.user-info strong {
    color: var(--text-primary);
}

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

label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: var(--bg-secondary);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: var(--text-secondary);
}

button, .btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

button {
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: #c82333;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    transform: translateY(-2px);
}

.message {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid;
    animation: fadeIn 0.3s ease-in;
}

.message.success {
    background: rgba(40, 167, 69, 0.15);
    color: #6fcf97;
    border-color: rgba(40, 167, 69, 0.3);
}

.message.error {
    background: rgba(220, 53, 69, 0.15);
    color: #ff6b6b;
    border-color: rgba(220, 53, 69, 0.3);
}

.back-link {
    text-align: center;
    margin-top: 1.5rem;
}

.back-link a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.back-link a:hover {
    color: var(--accent-secondary);
    transform: translateX(-5px);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}

.header .user-info strong {
    color: var(--text-primary);
}

.form-section {
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.form-section h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.users-table th,
.users-table td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table tr {
    transition: background 0.2s ease;
}

.users-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.users-table td {
    color: var(--text-secondary);
}

.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-admin {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.badge-user {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.loading {
    color: var(--text-secondary);
    text-align: center;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Selection styling */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

.divider {
    margin: 2rem 0;
    text-align: center;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--bg-secondary);
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.microsoft-login {
    margin-top: 1rem;
}

.microsoft-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.75rem;
    background: white;
    color: #5e5e5e;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.microsoft-btn:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.microsoft-btn svg {
    flex-shrink: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .container, .login-container, .admin-container {
        padding: 2rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .clock-time {
        font-size: 2.5rem;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
