/* Created 06/07/2025 By Linus Xiong */
/* maple-mono-latin-400-normal */
/* Edited 07/09/2025 by Moses Lytle - Modified fisplay to allow more digits to be observed with a scroll.  */
@font-face {
    font-family: 'Maple Mono';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url(https://cdn.jsdelivr.net/fontsource/fonts/maple-mono@latest/latin-400-normal.woff2) format('woff2'), url(https://cdn.jsdelivr.net/fontsource/fonts/maple-mono@latest/latin-400-normal.woff) format('woff');

}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Maple Mono', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #2c2c2c;
}

/* team Header */
.team-header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 1s ease-out;
}

.team-text {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24, #feca57, #ff9ff3);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    margin-bottom: 1rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.team-subtitle {
    color: #bbb;
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 1px;
    opacity: 0.8;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Calculator container */
.calculator {
    background: #000;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 350px;
    max-width: 100%;
}

/* Display screen */
.display {
    background: #000;
    color: #fff;
    font-size: 48px;
    font-weight: 300;
    text-align: right;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    min-height: 80px;
    overflow-x: auto;
    white-space: nowrap;
    line-height: 80px;
    scrollbar-width: none;
}

/* Button grid container */
.button-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* Base button styles */
.button {
    border: none;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 400;
    height: 70px;
    width: 70px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Button hover effects */
.button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

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

.number-button,
.dark-button {
    background: #333;
    color: #fff;
}

.number-button:hover,
.dark-button:hover {
    background: #404040;
}

/* Operator buttons - orange */
.operator-button {
    background: #ff9500;
    color: #fff;
    font-weight: 500;
}

.operator-button:hover {
    background: #ffb143;
}

.operator-button.active {
    background: #fff;
    color: #ff9500;
}

/* Function buttons - light gray */
.function-button {
    background: #a6a6a6;
    color: #000;
    font-weight: 500;
}

.function-button:hover {
    background: #bfbfbf;
}



/* Responsive design */
@media (max-width: 480px) {
    .calculator {
        width: 100%;
        max-width: 300px;
    }

    .button {
        height: 60px;
        width: 60px;
        font-size: 24px;
    }

    .display {
        font-size: 40px;
        min-height: 70px;
    }
}

/* Button text styling */
.button-text {
    pointer-events: none;
}

/* Scientific functions row (optional) */
.scientific-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.scientific-row.hidden {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
}

.scientific-button {
    background: #444;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    border-radius: 15px;
    height: 40px;
    width: auto;
}

.scientific-button:hover {
    background: #555;
}

/* History Modal Styles */
.history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.history-overlay.active {
    opacity: 1;
    visibility: visible;
}

.history-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: #1c1c1e;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    max-height: 70vh;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    z-index: 1001;
}

.history-overlay.active .history-modal {
    transform: translate(-50%, -50%) scale(1);
}

.history-header {
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-title {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
}

.history-close {
    background: none;
    border: none;
    color: #007aff;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
}

.history-close:hover {
    color: #0056b3;
}

.history-content {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.history-list {
    list-style: none;
}

.history-item {
    background: #2c2c2e;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #333;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #3a3a3c;
    transform: translateX(5px);
}

.history-item-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history-expression {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

.history-result {
    color: #ff9500;
    font-size: 18px;
    font-weight: 600;
}

.history-time {
    color: #8e8e93;
    font-size: 12px;
}

.history-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.history-action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-clear-btn {
    background: #ff3b30;
    color: #fff;
}

.history-clear-btn:hover {
    background: #d70015;
}

.empty-history {
    text-align: center;
    color: #8e8e93;
    font-size: 16px;
    padding: 40px 20px;
}

.empty-history i {
    font-size: 48px;
    color: #333;
    margin-bottom: 15px;
}

/* Calculator header */
.calculator-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 10px;
    height: 40px;
}

.history-button {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.history-button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}