* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1976d2;
    --secondary-color: #424242;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --light-bg: #f5f5f5;
    --dark-text: #333;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--light-bg);
    color: var(--dark-text);
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    height: 100vh;
    display: flex;
    position: relative;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.screen.active {
    display: block;
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

/* Login Screen */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.logo {
    margin-bottom: 40px;
}

.logo h1 {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    touch-action: manipulation;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1565c0;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #212121;
}

.btn-icon {
    font-size: 20px;
}

#google-login-btn {
    background-color: white;
    color: var(--dark-text);
    font-size: 18px;
    padding: 15px 40px;
    box-shadow: var(--shadow-lg);
}

#google-login-btn:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Loading Screen */
#loading-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#loading-screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader p {
    color: white;
    font-size: 18px;
}

/* Main App */
#main-screen {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--light-bg);
}

.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    box-shadow: var(--shadow);
    sticky: top 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
}

.user-email {
    font-size: 14px;
    opacity: 0.9;
    margin: 4px 0 0;
}

#logout-btn {
    white-space: nowrap;
}

/* App Content */
.app-content {
    flex: 1;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--light-bg);
    padding-bottom: 10px;
}

.profile-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--light-bg);
}

.info-row:last-child {
    border-bottom: none;
}

.label {
    font-weight: 600;
    color: var(--secondary-color);
}

.status-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--light-bg);
    border-radius: 4px;
}

.status-label {
    font-weight: 600;
}

.status-value {
    color: var(--success-color);
    font-weight: 600;
}

/* Notes Section */
.notes-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#notes-input {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

#notes-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.notes-display {
    padding: 12px;
    background-color: var(--light-bg);
    border-radius: 4px;
    min-height: 60px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.6;
}

/* Offline Indicator */
.offline-indicator {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--warning-color);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.offline-indicator.show {
    display: block;
}

@keyframes slideIn {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 36px;
    }

    .app-header {
        padding: 15px;
    }

    .app-header h1 {
        font-size: 24px;
    }

    .user-info {
        flex-wrap: wrap;
    }

    .avatar {
        width: 40px;
        height: 40px;
    }

    .app-content {
        padding: 15px;
    }

    .card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .info-row,
    .status-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-row span:first-child,
    .status-item .status-label {
        margin-bottom: 5px;
    }

    #google-login-btn {
        font-size: 16px;
        padding: 12px 30px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .logo h1 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 16px;
    }

    .app-header h1 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .btn {
        min-height: 44px;
    }

    .offline-indicator {
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
}

/* Print Styles */
@media print {
    .btn,
    .app-header,
    #logout-btn {
        display: none;
    }

    body {
        background: white;
    }

    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --light-bg: #1e1e1e;
        --dark-text: #e0e0e0;
        --border-color: #444;
    }

    body {
        background-color: #121212;
    }

    .card {
        background-color: #1e1e1e;
    }

    .status-item {
        background-color: #2a2a2a;
    }

    .notes-display {
        background-color: #2a2a2a;
    }

    #notes-input {
        background-color: #2a2a2a;
        color: #e0e0e0;
        border-color: #444;
    }
}
