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

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

:root {
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f4;
    --text-primary: #000000;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #e8eaed;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --accent-color: #000000;
    --accent-color-rgb: 0, 0, 0;
    --success-color: #00c851;
    --error-color: #ff4444;
    --warning-color: #ffbb33;
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-tertiary: #999999;
    --border-color: #333333;
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-medium: rgba(255, 255, 255, 0.15);
    --accent-color: #ffffff;
    --accent-color-rgb: 255, 255, 255;
    --success-color: #00e676;
    --error-color: #ff5252;
    --warning-color: #ffc107;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

#app {
    min-height: 100vh;
    position: relative;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.screen {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Beaverly Logo */
.logo::before {
    content: '';
    width: 32px;
    height: 32px;
    background-image: url('../attached_assets/beaverly_logoi.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 0.5rem;
}

[data-theme="dark"] .logo::before {
    background-image: url('../attached_assets/beaverly_lodo.png');
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 1rem;
    background: var(--accent-color);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.secondary-btn {
    width: 100%;
    padding: 1rem;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2rem;
}

.secondary-btn:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    color: var(--text-primary);
}

.icon-btn:hover {
    background: var(--bg-secondary);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Input Fields */
.input-field {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .input-field:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Password Strength Meter */
.password-strength-container {
    margin-bottom: 1rem;
}

.password-strength-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-requirements {
    display: none;
    list-style: none;
    font-size: 0.85rem;
    margin: 0;
    padding: 0;
}

.password-requirements li {
    margin: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.req-met {
    color: var(--success-color);
}

.req-met::before {
    content: '✓';
    font-weight: bold;
}

.req-unmet {
    color: var(--text-tertiary);
}

.req-unmet::before {
    content: '○';
}

/* Password Toggle Styles */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Responsive Design */
@media (min-width: 768px) {
    .main-content {
        padding: 80px 2rem 80px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 80px 4rem 80px;
    }
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* PWA Styles */
@media (display-mode: standalone) {
    .app-bar {
        padding-top: env(safe-area-inset-top);
    }

    .main-content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-medium);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 90%;
    animation: slideDown 0.3s ease;
}

.notification-success { border-left: 4px solid var(--success-color); }
.notification-error { border-left: 4px solid var(--error-color); }
.notification-warning { border-left: 4px solid var(--warning-color); }
.notification-info { border-left: 4px solid var(--accent-color); }

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    overflow-y: auto;
}
