/* Porsche Club Sverige Base CSS */

:root {
    /* Färgschema */
    --pcs-primary: #1a1a1a;
    --pcs-secondary: #4a4a4a;
    --pcs-accent: #8B4513;
    --pcs-light-grey: #f8f9fa;
    --pcs-success: #28a745;
    --pcs-warning: #ffc107;
    --pcs-danger: #dc3545;
    
    /* Typografi */
    --font-primary: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--pcs-primary);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e9ecef;
}

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

.site-logo img {
    height: 40px;
    width: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pcs-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

/* Main Content */
.site-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

.welcome-card {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    border-left: 4px solid var(--pcs-accent);
}

.welcome-card h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--pcs-primary);
}

.welcome-card p {
    font-size: 1.1rem;
    color: var(--pcs-secondary);
    margin-bottom: 1rem;
}

.info-text {
    font-size: 0.95rem;
    color: #6c757d;
    font-style: italic;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    margin: 0.5rem 0.5rem 0.5rem 0;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: var(--pcs-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 26, 26, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--pcs-primary);
    color: var(--pcs-primary);
}

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

/* Alerts */
.alert {
    padding: 1rem;
    margin: 1rem auto;
    max-width: 1200px;
    border-radius: 6px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--pcs-success);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--pcs-warning);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--pcs-danger);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
    font-size: 0.85rem;
    border-top: 1px solid #e9ecef;
    background: white;
}

.site-footer p {
    margin: 0.25rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header {
        padding: 0.5rem 0;
    }
    
    .site-header .container {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0 1rem;
    }
    
    .site-logo img {
        height: 28px;
    }
    
    .user-info {
        gap: 0.5rem;
        font-size: 0.85rem;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .site-main {
        padding: 1rem 0.5rem;
    }
    
    .welcome-card {
        padding: 1.5rem 1rem;
    }
    
    .welcome-card h1 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 0.25rem 0;
    }
    
    .site-header .container {
        padding: 0 0.5rem;
        gap: 0.25rem;
    }
    
    .site-logo img {
        height: 24px;
    }
    
    .user-info {
        font-size: 0.75rem;
    }
    
    .user-info > div:last-of-type {
        display: none;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .site-main {
        padding: 0.5rem 0.25rem;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    background: white;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.loading-content h2 {
    margin: 1rem 0 0.5rem;
    color: var(--pcs-primary);
}

.loading-content p {
    color: var(--pcs-secondary);
    margin: 0.5rem 0;
}

/* Spinner Animation */
.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border: 6px solid var(--pcs-light-grey);
    border-top-color: var(--pcs-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Button styles for the fetch event button */
.btn-secondary {
    background: var(--pcs-secondary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--pcs-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.modal-content h2 {
    color: var(--pcs-success);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.match-details {
    text-align: left;
    margin-bottom: 1.5rem;
}

.match-details p {
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: var(--pcs-light-grey);
    border-radius: 6px;
    border-left: 3px solid var(--pcs-accent);
}

.match-details strong {
    color: var(--pcs-primary);
    display: inline-block;
    min-width: 80px;
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem 1rem;
        margin: 1rem;
    }
    
    .modal-content h2 {
        font-size: 1.2rem;
    }
    
    .match-details strong {
        min-width: 70px;
        font-size: 0.9rem;
    }
}
