body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: 100vh;
    margin: 0;
    background: linear-gradient(45deg, #2c3e50, #3498db);
    font-family: 'Arial', sans-serif;
    position: relative;
    overflow: hidden;
}

.calculator {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 300px;
    width: 90%;
    margin-bottom: 60px;
}

.display {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    text-align: right;
    color: white;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

#result {
    font-size: 2em;
    margin-bottom: 5px;
}

.preview {
    min-height: 20px;
    text-align: right;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease-out, height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
    pointer-events: none;
}

.btn:active::after {
    width: 200%;
    height: 200%;
    opacity: 1;
    transition: 0s;
}

.btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

/* Spezielle Styling für Operatoren */
.btn:nth-child(4n),
.btn:last-child {
    background: rgba(52, 152, 219, 0.3);
}

/* Styling für Clear und Delete Buttons */
.btn:nth-child(1),
.btn:nth-child(2) {
    background: rgba(231, 76, 60, 0.3);
}

/* Styling für die Null-Taste */
.zero {
    grid-column: span 2;
}

/* Styles for the website link button */
.website-link {
    position: fixed;  /* changed from absolute to fixed */
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 1000;   /* added z-index */
}

.website-button {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);  /* slightly more visible */
    backdrop-filter: blur(10px);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);  /* slightly more visible border */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);    /* added shadow for better visibility */
}

/* Responsive styles for mobile devices */
@media screen and (max-width: 480px) {
    * {
        touch-action: manipulation;
    }
    
    body {
        background: linear-gradient(45deg, #2980b9, #6eb0e5);
        padding-bottom: 60px;
    }

    .calculator {
        width: 95%;
        padding: 15px;
        margin-bottom: 70px;  /* increased margin to avoid overlap */
    }

    .display {
        font-size: 1.5em;
        padding: 15px;
        min-height: 70px;
    }

    .buttons {
        gap: 8px;
    }

    .btn {
        padding: 18px;
        font-size: 1.3em;
        border-radius: 12px;
        min-height: 60px;
    }

    .website-button {
        padding: 10px 20px;  /* increased padding */
        font-size: 1em;      /* increased font size */
        background: rgba(255, 255, 255, 0.2);  /* more visible on mobile */
    }

    body {
        padding-bottom: 60px;
    }

    #result {
        font-size: 2.2em;
    }

    .preview {
        font-size: 1.1em;
    }

    /* Ensure proper touch target size */
    .btn:active {
        transform: scale(0.98);
        background: rgba(255, 255, 255, 0.2);
    }
    
    .btn:active::after {
        width: 150%;
        height: 150%;
    }
}

/* Tablet styles */
@media screen and (min-width: 481px) and (max-width: 1024px) {
    .calculator {
        max-width: 400px;
        padding: 20px;
    }

    .display {
        padding: 20px;
        min-height: 80px;
    }

    #result {
        font-size: 2.5em;
    }

    .preview {
        font-size: 1.2em;
    }

    .buttons {
        gap: 12px;
    }

    .btn {
        padding: 20px;
        font-size: 1.4em;
        border-radius: 15px;
    }
}

/* Add touch device optimizations */
@media (hover: none) {
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(0.97);
    }

    .btn {
        -webkit-tap-highlight-color: transparent;
    }
}

@keyframes popZoom {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.02);
        filter: brightness(1.2);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.calc-animation {
    animation: popZoom 0.4s cubic-bezier(0.36, 0, 0.66, 1);
    animation-fill-mode: forwards;
}

/* Remove or comment out the old wind-animation styles */
/* .wind-animation { ... } */
