::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1c1c1c;
}

::-webkit-scrollbar-thumb {
    background: var(--color);
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0a6bb5;
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    user-select: none;

    --color: #0b81cf;
}


body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-color: #121212;
}

.dark-mode{
    background-color: #1b1b1b;
    transition: all 0.2s;
}

.light-mode{
    background-color: #ffffff;
    transition: all 0.2s;
}

.message-container{
    z-index: 10;
    position: fixed;
    width: 90%;
    max-width: 450px;
    overflow-y: auto;
    max-height: 70vh;  
    background-color: #333;
    animation: wjazd 0.5s ease forwards;
    border: 2px solid var(--color);
    border-radius: 20px;
    padding-bottom: 10px;
}

@keyframes wjazd {
    0%{
        transform: translateY(-6%);
        opacity: 0;
    }
    100%{
        transform: translateY(0);
        opacity: 1;
    }
    
}

.message-container h2{
    text-align: center;
    color: #fff;
    padding: 10px 0;
}

.message-container p{
    color: #fff;
    padding: 0 20px 10px 20px;
    line-height: 1.4;
}

.message-container p span{
    font-weight: 600;
    color: var(--color);
}
.message-container p a {
    color: var(--color);
    text-decoration: underline;
}

.buttons-message{
    position: sticky;
    bottom: 0;
    background-color: #333;
    padding: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
    border-top: 2px solid #555;
}
.close-message-btn{
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    background-color: red;
}
.close-message-btn:hover{
    opacity: 0.8;
}
.close-message-btn:active{
    transform: scale(0.95);
}

.message-btn {
    position: fixed;
    top: 90px;
    right: 10px;
    padding: 8px 16px;
    background-color: #4a4a4a;
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.message-btn:hover{
    opacity: 0.8;
}
.message-btn:active{
    transform: scale(0.95);
}

.container{
    width: 100%;
    max-width: 400px;
    height: auto;
    max-height: 90vh;
    overflow: hidden;
    background-color: #333;
    border-radius: 15px;
    border: 2px solid var(--color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    align-items: center;
    gap: 15px;
    padding: 20px;
    position: relative;
}

.style-btn{
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 16px;
    background-color: #f0e68c;
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.style-btn:hover{
    opacity: 0.8;
}

.style-btn:active{
    transform: scale(0.95);
}



.historia-btn{
    position: fixed;
    top: 50px;
    right: 10px;
    padding: 8px 16px;
    background-color: #4a4a4a;
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.historia-btn:hover{
    opacity: 0.8;
}

.historia-btn:active{
    transform: scale(0.95);
}

.historia-container{
    z-index: 10;
    visibility: hidden;
    position: fixed;
    width: 90%;
    max-width: 450px;
    overflow-y: auto;
    max-height: 70vh;  
    animation: wjazd 0.5s ease forwards;
    background-color: #333;
    border: 2px solid var(--color);
    border-radius: 20px;
}
@keyframes wjazd {
    0%{
        transform: translateY(-6%);
        opacity: 0;
    }
    100%{
        transform: translateY(0);
        opacity: 1;
    }
    
}

.historia-container h2{
    text-align: center;
    color: #fff;
    padding: 10px 0;
}
.historia-list{
    list-style: none;
    padding: 0 20px 20px 20px;
}
.historia-list li{
    color: #fff;
    padding: 8px 0;
    border-bottom: 1px solid #555;
}

.buttons-historia{
    position: sticky;
    bottom: 0;
    background-color: #333;
    padding: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
    border-top: 2px solid #555;
}

.close-historia-btn, .clear-historia-btn{
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.close-historia-btn{
    background-color: #f44336;
}

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

.close-historia-btn:hover, .clear-historia-btn:hover{
    opacity: 0.8;
}

.close-historia-btn:active, .clear-historia-btn:active{
    transform: scale(0.95);
}

.conversion-panel{
    width: 350px;
    background-color: #1c1c1c;
    border-radius: 10px;
    padding: 10px;
}

.system-selector{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.system-btn{
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background-color: #2a2a2a;
    color: #888;
    transition: all 0.2s;
}

.system-btn:hover{
    background-color: #3a3a3a;
}

.system-btn.active{
    background-color: var(--color);
    color: #000;
}

.screan{
    width: 350px;
    height: 100px;
    background-color: #1c1c1c;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    align-items: flex-end;
    justify-content: space-between;
    padding:10px 20px;
}

.previous-display{
    font-size: 20px;
    overflow: hidden;
    color: #888;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 24px;
}

.display{
    font-size: 48px;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.number-btn{
    width: 350px;
    height: 400px;
    background-color: transparent;
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px;
}

.btn{
    border: none;
    border-radius: 10px;
    font-size: 24px;
    font-weight: 500;
    cursor: pointer;
    background-color: #505050;
    color: #fff;
    transition: all 0.2s;
}

.btn:hover{
    opacity: 0.8;
}

.btn:active{
    transform: scale(0.95);
}

.btn.function{
    background-color: #a5a5a5;
    color: #000;
}

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

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

.btn.zero{
    grid-column: span 2;
}

/* Dla dużych ekranów (laptopy, desktopy) */
@media (min-width: 1200px) {
    body{
        padding: 30px;
    }

    .container{
        max-width: 450px;
        max-height: 85vh;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .container{
        max-width: 400px;
        max-height: 80vh;
    }
}

@media (max-width: 768px) {
    body{
        padding: 15px;
    }

    .container{
        width: 90vw;
        max-width: 400px;
        height: auto;
        min-height: 550px;
        max-height: 85vh;
    }

    .screan{
        width: 85%;
    }

    .conversion-panel{
        width: 85%;
    }

    .number-btn{
        width: 85%;
        height: auto;
        aspect-ratio: 1 / 1.1;
    }

    .corner-btn{
        top: 5px;
        right: 5px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    body{
        padding: 10px;
    }

    .container{
        width: 100%;
        max-width: 380px;
        padding: 15px;
        gap: 10px;
    }

    .screan{
        width: 100%;
        height: 80px;
        padding: 10px 15px;
    }

    .previous-display{
        font-size: 16px;
        min-height: 20px;
    }

    .display{
        font-size: 36px;
    }

    .conversion-panel{
        width: 100%;
        padding: 8px;
    }

    .system-btn{
        padding: 8px;
        font-size: 14px;
    }

    .number-btn{
        width: 100%;
        gap: 8px;
        padding: 8px;
    }

    .btn{
        font-size: 20px;
        min-height: 60px;
    }

    .corner-btn{
        top: 5px;
        right: 5px;
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* Dla bardzo małych ekranów */
@media (max-width: 360px) {
    body{
        padding: 10px;
    }

    .container{
        height: auto;
        min-height: 500px;
        max-height: 85vh;
        padding: 15px;
    }

    .screan{
        height: 70px;
    }

    .display{
        font-size: 32px;
    }

    .previous-display{
        font-size: 14px;
    }

    .btn{
        font-size: 18px;
        min-height: 50px;
    }

    .system-btn{
        padding: 6px;
        font-size: 12px;
    }

    .historia-container{
        max-width: 95%;
        max-height: 60vh;
    }
}


