* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #3498db, #9b59b6);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-card {
    background-color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 150px;
    flex-grow: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    opacity: 0;
    transform: translateY(15px);
    animation: stats-entrance 0.5s forwards;
    animation-delay: calc(var(--index) * 0.15s);
    position: relative;
    overflow: hidden;
}

@keyframes stats-entrance {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    background-color: #f8f9ff;
}

.stat-card:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(52, 152, 219, 0.1), transparent);
    pointer-events: none;
    animation: pulse 1.5s infinite;
}


.stat-card h3 {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 5px;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.9; }
    100% { opacity: 0.6; }
}

.stat-card:hover h3 {
    color: #2980b9;
    transition: color 0.3s ease;
}

.stat-card p {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-filter {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-bar {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    min-width: 200px;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
    min-width: 150px;
}

.coaster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.coaster-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.4s ease,
                filter 0.3s ease;
    position: relative;
    opacity: 0;
    transform: translateY(30px) rotateY(10deg);
    animation: card-entrance 0.6s forwards;
    animation-delay: calc(var(--index) * 0.1s);
}

@keyframes card-entrance {
    to {
        opacity: 1;
        transform: translateY(0) rotateY(0);
    }
}

.coaster-card:hover {
    transform: translateY(-12px) rotateX(2deg) rotateZ(1deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(52, 152, 219, 0.2);
    filter: brightness(1.03);
}

.coaster-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(to right, rgba(52, 152, 219, 0.3), rgba(155, 89, 182, 0.3));
    z-index: 1;
    transition: height 0.3s ease;
}

.coaster-card:hover::before {
    height: 5px;
}

.coaster-card:hover .coaster-image {
    transform: scale(1.05);
    transition: transform 0.5s ease;
}

.coaster-image {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    transform: scale(1);
    transition: transform 0.5s ease;
}

.coaster-image.no-image {
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    font-size: 1.5rem;
}

.ride-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(41, 128, 185, 0.85);
    color: white;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* New ride counter with increment button */
/* New ride counter with increment button */
.ride-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(30, 144, 255, 0.8);
    border-radius: 20px;
    padding: 3px 10px;
    color: white;
    font-weight: bold;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.increment-button {
    color: white;
    margin-left: 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    font-weight: bold;
    border: none;
    background: transparent;
    transition: transform 0.2s ease;
    padding: 0 2px;
}

.increment-button:hover {
    transform: scale(1.2);
}

.increment-button:active {
    transform: scale(0.95);
}

.coaster-details {
    padding: 15px;
}

.coaster-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.coaster-park {
    color: #7f8c8d;
    margin-bottom: 10px;
    font-size: 1rem;
}

.coaster-info {
    display: flex;
    justify-content: space-between;
    color: #95a5a6;
    font-size: 0.9rem;
}

.error-message {
    text-align: center;
    padding: 30px;
    background-color: #fee;
    color: #e74c3c;
    border-radius: 5px;
    margin: 20px 0;
}

@media (max-width: 768px) {

    .stat-card:hover {
        transform: translateY(-5px) scale(1.02);
    }
    
    .coaster-card:hover {
        transform: translateY(-8px) rotateX(1deg) rotateZ(0.5deg);
    }
    
    .coaster-grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .stat-card {
        min-width: 120px;
    }
}

/* Enhanced loader animation */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 100;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader-inner {
    margin: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: dodgerblue;
    display: inline-block;
    animation: bounce 0.6s infinite alternate;
}

.loader-inner.one {
    animation-delay: 0s;
}

.loader-inner.two {
    animation-delay: 0.2s;
}

.loader-inner.three {
    animation-delay: 0.4s;
}

@keyframes bounce {
    to {
        transform: translateY(-10px);
    }
}

.loader-text {
    margin-top: 20px;
    font-size: 1.2rem;
    text-align: center;
    color: #7f8c8d;
    font-weight: bold;
}

/* User profile section */
.user-profile {
    background-color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-right: 15px;
}

.profile-info {
    flex-grow: 1;
}

.profile-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
}

.profile-stats {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 3px;
}

.logout-button {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logout-button:hover {
    background-color: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.logout-button:active {
    background-color: #b71c1c;
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Falls der Button manchmal versteckt werden soll */
.logout-button.hidden {
    display: none;
}

/* Toast notification for ride increment */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    font-weight: 500;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Spinner for button */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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