:root {
    --primary-color: #ef5423;
    --secondary-color: #642363;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --danger-color: #dc3545;
    --success-color: #28a745;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    margin-left: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

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

main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

footer {
    padding: 1rem 0;
    background-color: var(--dark-color);
    color: white;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Cards */
.card {
    background: white;
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Toast/Popup Message */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background-color: white;
    color: #333;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    transform: translateY(150%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

/* Message Popup styling - Simplified for Safari compatibility */
.message-popup {
    position: fixed;
    bottom: 20px;
    right: -400px; /* Start off-screen */
    max-width: 350px;
    width: 90%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 15px;
    z-index: 1000;
    transition: right 0.5s ease-in-out;
}

.message-popup.show {
    right: 20px; /* Move on-screen */
}

.message-popup .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.message-popup .close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
}

.message-popup .message {
    padding: 8px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-popup .timestamp {
    display: block;
    font-size: 0.8rem;
    color: #777;
    text-align: right;
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        margin-top: 0.5rem;
        align-self: flex-start;
    }

    .nav-links a {
        margin-left: 0;
        margin-right: 1rem;
    }
}

.welcome-section {
        text-align: center;
        margin: 3rem 0;
    }
    
    .welcome-section h1 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
        color: var(--primary-color);
    }
    
    .welcome-section p {
        font-size: 1.1rem;
        max-width: 800px;
        margin: 0 auto 2rem;
        line-height: 1.6;
    }
    
    .login-button {
        display: inline-block;
        font-size: 1.2rem;
        padding: 15px 40px;
        background-color: var(--primary-color);
        color: white;
        text-decoration: none;
        border-radius: 5px;
        transition: background-color 0.3s, transform 0.3s;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    .login-button:hover {
        background-color: var(--secondary-color);
        transform: translateY(-3px);
    }
    
    .cards-container {
        display: flex;
        flex-wrap: wrap;
        gap: 2rem;
        justify-content: center;
        margin-top: 3rem;
        margin-bottom: 3rem;
    }
    
    .card {
        flex: 1;
        min-width: 300px;
        max-width: 45%;
        border-radius: 8px;
        padding: 2rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        background-color: white;
        transition: transform 0.3s, box-shadow 0.3s;
    }
    
    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    }
    
    .card h3 {
        color: var(--primary-color);
        margin-bottom: 1rem;
        font-size: 1.5rem;
    }
    
    .card p {
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .card-button {
        display: inline-block;
        padding: 8px 20px;
        background-color: var(--primary-color);
        color: white;
        text-decoration: none;
        border-radius: 5px;
        border: none;
        cursor: pointer;
        transition: background-color 0.3s;
    }
    
    .card-button:hover {
        background-color: var(--secondary-color);
    }
    
    @media (max-width: 768px) {
        .cards-container {
            flex-direction: column;
        }
        
        .card {
            max-width: 100%;
        }
    }
    
    .auth-required-message {
        display: none;
        background-color: #fff3cd;
        color: #856404;
        padding: 1rem;
        border-radius: 5px;
        margin-top: 1rem;
        border-left: 4px solid #ffc107;
    }
    
    .message-popup {
        position: fixed;
        bottom: 20px;
        right: 20px;
        max-width: 300px;
        background-color: white;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        padding: 15px;
        z-index: 1000;
        transform: translateX(400px);
        transition: transform 0.5s ease-in-out;
    }
    
    .message-popup.show {
        transform: translateX(0);
    }
    
    .message-popup .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eee;
    }
    
    .message-popup .close {
        background: none;
        border: none;
        font-size: 1.2rem;
        cursor: pointer;
    }
    
    .message-popup .message {
        padding: 8px 0;
    }
    
    .message-popup .timestamp {
        display: block;
        font-size: 0.8rem;
        color: #777;
        text-align: right;
        margin-top: 5px;
    }

.welcome-message {
        margin-bottom: 2rem;
    }
    
    .user-info-section {
        background-color: #f8f9fa;
        border-radius: 8px;
        padding: 1.5rem;
        margin-bottom: 2rem;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .user-info-header {
        display: flex;
        align-items: center;
        margin-bottom: 1.5rem;
    }
    
    .user-avatar {
        width: 65px;
        height: 65px;
        border-radius: 50%;
        margin-right: 1rem;
        object-fit: cover;
    }
    
    .user-name {
        font-size: 1.5rem;
        margin: 0 0 0.25rem 0;
        color: var(--primary-color);
    }
    
    .user-email {
        margin: 0;
        color: #6c757d;
    }
    
    .session-data {
        background-color: #f1f1f1;
        border-radius: 5px;
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .session-data pre {
        margin: 0;
        white-space: pre-wrap;
        word-break: break-word;
    }
    
    .cards-container {
        display: flex;
        flex-wrap: wrap;
        gap: 2rem;
        justify-content: center;
        margin-top: 3rem;
        margin-bottom: 3rem;
    }
    
    .card {
        flex: 1;
        min-width: 300px;
        max-width: 45%;
        border-radius: 8px;
        padding: 2rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        background-color: white;
        transition: transform 0.3s, box-shadow 0.3s;
    }
    
    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    }
    
    .card h3 {
        color: var(--primary-color);
        margin-bottom: 1rem;
        font-size: 1.5rem;
    }
    
    .card p {
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .card-button {
        display: inline-block;
        padding: 8px 20px;
        background-color: var(--primary-color);
        color: white;
        text-decoration: none;
        border-radius: 5px;
        border: none;
        cursor: pointer;
        transition: background-color 0.3s;
    }
    
    .card-button:hover {
        background-color: var(--secondary-color);
    }
    
    @media (max-width: 768px) {
        .cards-container {
            flex-direction: column;
        }
        
        .card {
            max-width: 100%;
        }
    }
    
    .message-popup {
        position: fixed;
        bottom: 20px;
        right: 20px;
        max-width: 300px;
        background-color: white;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        padding: 15px;
        z-index: 1000;
        transform: translateX(400px);
        transition: transform 0.5s ease-in-out;
    }
    
    .message-popup.show {
        transform: translateX(0);
    }
    
    .message-popup .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eee;
    }
    
    .message-popup .close {
        background: none;
        border: none;
        font-size: 1.2rem;
        cursor: pointer;
    }
    
    .message-popup .message {
        padding: 8px 0;
    }
    
    .message-popup .timestamp {
        display: block;
        font-size: 0.8rem;
        color: #777;
        text-align: right;
        margin-top: 5px;
    }
    
    .status-indicator {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        margin-right: 8px;
    }
    
    .status-connected {
        background-color: #28a745;
    }
    
    .status-disconnected {
        background-color: #dc3545;
    }
    
    .connection-status {
        margin-bottom: 1.5rem;
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
        border-radius: 4px;
        display: inline-flex;
        align-items: center;
    }

.auth-error-container {
        text-align: center;
        padding: 3rem 1rem;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .auth-error-icon {
        font-size: 4rem;
        color: #dc3545;
        margin-bottom: 1.5rem;
    }
    
    .auth-error-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
        color: #dc3545;
    }
    
    .auth-error-description {
        margin-bottom: 2.5rem;
        font-size: 1.2rem;
        line-height: 1.6;
    }
    
    .auth-error-button {
        display: inline-block;
        padding: 12px 28px;
        background-color: var(--primary-color);
        color: white;
        text-decoration: none;
        border-radius: 5px;
        font-size: 1.1rem;
        transition: background-color 0.3s;
    }
    
    .auth-error-button:hover {
        background-color: var(--secondary-color);
    }