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

:root {
    --primary: #4285f4;
    --primary-dark: #3367d6;
    --success: #34a853;
    --warning: #fbbc04;
    --error: #ea4335;
    --background: #f8f9fa;
    --surface: #ffffff;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border: #dadce0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Splash Screen */
.splash-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Auth View */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 60px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    color: var(--primary);
    margin-bottom: 16px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    background: var(--surface);
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    width: auto;
}

.auth-form .btn {
    margin-bottom: 12px;
}

.auth-toggle {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-toggle a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

#google-signin-container {
    display: flex;
    justify-content: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 12px;
}

.message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.message.success {
    background: rgba(52, 168, 83, 0.1);
    color: var(--success);
}

.message.error {
    background: rgba(234, 67, 53, 0.1);
    color: var(--error);
}

/* Main View */
.header {
    background: var(--surface);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--error);
}

.connection-status.connected .status-dot {
    background: var(--success);
}

.connection-status.connecting .status-dot {
    background: var(--warning);
}

.user-menu {
    position: relative;
}

.btn-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 200;
}

.dropdown.show {
    display: block;
}

.dropdown a {
    display: block;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
}

.dropdown a:hover {
    background: var(--background);
}

.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    box-shadow: var(--shadow);
}

.notification-item.unread {
    border-left: 3px solid var(--primary);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.notification-app {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.app-badge.sms {
    background: rgba(66, 133, 244, 0.1);
    color: var(--primary);
}

.app-badge.viber {
    background: rgba(124, 82, 149, 0.1);
    color: #7c5295;
}

.app-badge.whatsapp {
    background: rgba(37, 211, 102, 0.1);
    color: #25d366;
}

.app-badge.telegram {
    background: rgba(0, 136, 204, 0.1);
    color: #0088cc;
}

.app-badge.messenger {
    background: rgba(0, 132, 255, 0.1);
    color: #0084ff;
}

.notification-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.notification-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.notification-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notification-footer {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.loading {
    display: flex;
    justify-content: center;
    padding: 24px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#btn-load-more {
    margin: 24px auto;
    display: block;
}

/* Responsive */
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .header-left, .header-right {
        justify-content: space-between;
    }

    .filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    .filter-btn {
        flex-shrink: 0;
    }

    .main-content {
        padding: 16px;
    }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.toast {
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.auth-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(248, 249, 250, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border-radius: 0;
    z-index: 10;
}

.auth-loading-overlay p {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

.auth-footer {
    text-align: center;
    padding: 16px 0 0;
    font-size: 13px;
}

.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
