/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00d4ff;
    --secondary-color: #ff00ff;
    --dark-bg: #0a0a0a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --error-color: #ff4757;
    --success-color: #00ff88;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, var(--primary-color) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, var(--secondary-color) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, #00ff88 0%, transparent 50%);
    opacity: 0.15;
    animation: gradientShift 20s ease infinite;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.01) 35px, rgba(255,255,255,.01) 70px);
    z-index: -1;
}

@keyframes gradientShift {
    0%, 100% { transform: rotate(0deg) scale(1); }
    33% { transform: rotate(120deg) scale(1.1); }
    66% { transform: rotate(240deg) scale(0.9); }
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: fadeInUp 0.8s ease;
}

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

.login-box {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

/* Glass shine effect */
.login-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s ease infinite;
}

@keyframes shine {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.login-box h1 {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glow 3s ease infinite;
}

@keyframes glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.login-box h2 {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 40px;
    text-align: center;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    font-family: inherit;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2300d4ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    position: relative;
}

.form-group select:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(0, 212, 255, 0.5);
}

.form-group select:active {
    background-color: rgba(255, 255, 255, 0.06);
}

.form-group select option {
    background: #1a1a1a;
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 0;
    font-size: 15px;
}

.form-group select option:hover,
.form-group select option:focus,
.form-group select option:checked {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(255, 0, 255, 0.2));
    color: var(--primary-color);
}

.form-group select option:disabled {
    color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    box-shadow: 
        0 0 0 3px rgba(0, 212, 255, 0.1),
        0 0 20px rgba(0, 212, 255, 0.2);
}

.form-group input:focus + .input-glow,
.form-group select:focus + .input-glow,
.form-group textarea:focus + .input-glow {
    opacity: 1;
}

/* Input glow effect */
.input-glow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

/* Button Styles */
.btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 32px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 
        0 4px 15px rgba(0, 212, 255, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 212, 255, 0.4),
        0 0 40px rgba(255, 0, 255, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(0, 212, 255, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Error Message */
.error-message {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--error-color);
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    backdrop-filter: blur(10px);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background: var(--dark-bg);
    position: relative;
    width: 100%;
}

.dashboard-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, var(--primary-color) 0%, transparent 30%),
        radial-gradient(circle at 80% 80%, var(--secondary-color) 0%, transparent 30%);
    opacity: 0.05;
    z-index: 0;
}

.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
    width: 100%;
}

.navbar h1 {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar .user-info {
    display: flex;
    align-items: center;
    gap: 24px;
}

.navbar .user-info span {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.navbar .btn-logout {
    padding: 10px 20px;
    font-size: 14px;
    background: rgba(255, 71, 87, 0.2);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--error-color);
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.navbar .btn-logout:hover {
    background: rgba(255, 71, 87, 0.3);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.2);
    transform: translateY(-2px);
}

.content {
    padding: 30px;
    position: relative;
    z-index: 5;
    width: 100%;
    box-sizing: border-box;
}

/* Wide content for specific pages */
.content.wide {
    padding: 30px 40px;
    width: 100%;
}

/* Ultra-wide for hardware page */
.content.ultra-wide {
    padding: 30px 50px;
    width: 100%;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 212, 255, 0.1);
}

.card h2 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.card p, .card li {
    color: var(--text-secondary);
    line-height: 1.6;
}

.card ul {
    list-style: none;
    padding: 0;
}

.card li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.card li:hover {
    padding-left: 8px;
    color: var(--primary-color);
}

.card li:last-child {
    border-bottom: none;
}

/* Loading animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Logo Container */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo-container svg {
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
}

/* Login Footer */
.login-footer {
    margin-top: 32px;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.login-footer p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1);
    }
}

/* Loading state for button */
.btn-primary.loading {
    pointer-events: none;
    position: relative;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Success animation */
@keyframes success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.success {
    animation: success 0.5s ease;
}

/* Universal Select Styling (for selects outside .form-group) */
select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2300d4ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    padding-right: 40px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

select:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(0, 212, 255, 0.5);
}

select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    box-shadow:
        0 0 0 3px rgba(0, 212, 255, 0.1),
        0 0 20px rgba(0, 212, 255, 0.2);
}

select:active {
    background-color: rgba(255, 255, 255, 0.06);
}

select option {
    background: #1a1a1a;
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 0;
    font-size: 15px;
}

select option:hover,
select option:focus,
select option:checked {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(255, 0, 255, 0.2));
    color: var(--primary-color);
}

select option:disabled {
    color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

/* Dashboard Grid Layout */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.feature-card {
    cursor: pointer;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 212, 255, 0.2);
    border-color: var(--primary-color);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.card-header svg {
    color: var(--primary-color);
    width: 24px;
    height: 24px;
}

.welcome-section {
    margin-bottom: 32px;
}

.welcome-section .card {
    background: linear-gradient(135deg, var(--glass-bg), rgba(0, 212, 255, 0.05));
    border: 1px solid var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .navbar .user-info {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
    }
    
    .login-box h1 {
        font-size: 24px;
    }
    
    .content {
        padding: 20px;
    }
    
    .logo-container svg {
        width: 50px;
        height: 50px;
    }
}