:root {
    /* Color Palette - Sura White and Blue Theme */
    --color-primary: #0033a0;      /* Deep Blue */
    --color-primary-light: #0055ff; /* Bright Blue */
    --color-secondary: #00a4e4;    /* Light Blue */
    
    --color-bg: #f4f7f9;           /* Off-white background */
    --color-text-main: #1a202c;    /* Dark gray for text */
    --color-text-muted: #4a5568;   /* Muted text */
    --color-text-inverse: #ffffff;
    
    --color-error: #e53e3e;
    --color-error-bg: #fed7d7;
    
    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(0, 51, 160, 0.08);
    --glass-blur: blur(12px);

    /* Transitions & Shadows */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-hover: 0 12px 40px 0 rgba(0, 51, 160, 0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Background Decorations (Blobs) */
.background-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-secondary) 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-primary-light) 0%, transparent 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, 50px) scale(1.1); }
}

/* Common Layouts */
#app-container {
    width: 100%;
    min-height: 100vh;
}

.screen {
    width: 100%;
    min-height: 100vh;
}

/* Glass Panel Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
}

/* --- Login Section --- */
#login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    animation: slideUp 0.6s ease-out forwards;
}

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

.brand-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-placeholder {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 51, 160, 0.3);
}

.brand-header h1 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.brand-header .subtitle {
    color: var(--color-text-muted);
    font-size: 1rem;
    font-weight: 500;
}

/* Forms */
.input-group {
    margin-bottom: 1.5rem;
}

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

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(0, 51, 160, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--color-text-main);
    transition: var(--transition-fast);
}

.input-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 51, 160, 0.1);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: var(--color-text-inverse);
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 51, 160, 0.3);
}

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

.btn-secondary {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(0, 51, 160, 0.2);
    border-radius: 8px;
    background: transparent;
    color: var(--color-primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(0, 51, 160, 0.05);
    border-color: var(--color-primary);
}

.btn-microsoft {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #8c8c8c;
    border-radius: 8px;
    background: #ffffff;
    color: #5e5e5e;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn-microsoft:hover {
    background: #f3f2f1;
    border-color: #323130;
    color: #323130;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.divider span {
    padding: 0 10px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Loading States */
.btn-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* Error Message */
.error-message {
    background: var(--color-error-bg);
    color: var(--color-error);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: shake 0.4s ease-in-out;
}

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

/* Global Loader */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
}

#global-loader .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 51, 160, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* --- Dashboard Section --- */
#dashboard-section {
    display: flex;
    flex-direction: column;
}

.glass-header {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand h2 {
    color: var(--color-primary);
    font-size: 1.25rem;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-email {
    font-weight: 500;
    color: var(--color-text-muted);
}

.dashboard-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    width: 100%;
}

.welcome-banner {
    padding: 2rem;
    margin-bottom: 3rem;
    animation: slideUp 0.5s ease-out;
}

.welcome-banner h3 {
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.welcome-banner p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.app-card {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
    animation: slideUp 0.6s ease-out backwards;
}

.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.3s; }

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 51, 160, 0.2);
}

.app-icon {
    font-size: 2.5rem;
    margin-right: 1.5rem;
    background: rgba(0, 51, 160, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    transition: var(--transition-fast);
}

.app-card:hover .app-icon {
    background: rgba(0, 51, 160, 0.1);
    transform: scale(1.05);
}

.app-info h4 {
    color: var(--color-text-main);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.app-info p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
}
