* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.page-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #333;
}

nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

nav a {
    text-decoration: none;
    color: #2196F3;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #e3f2fd;
}

nav a.active {
    background-color: #2196F3;
    color: white;
}

/* Professional calculator styling */
.calculator {
    background-color: #1a1a2e;
    border-radius: 16px;
    overflow: hidden;
    width: 340px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin: 0 auto 40px;
    border: 1px solid #3a3a5a;
}

.display {
    background-color: #0c0c1d;
    color: white;
    text-align: right;
    padding: 20px;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    word-wrap: break-word;
    word-break: break-all;
    border-bottom: 1px solid #2a2a45;
    position: relative;
    overflow: hidden;
}

.display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.previous-operand {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    min-height: 24px;
    font-family: 'Consolas', monospace;
}

.current-operand {
    font-size: 2.8rem;
    font-weight: bold;
    font-family: 'Consolas', monospace;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.result-animation {
    animation: result-fade 0.3s ease-in-out;
}

.memory-animation {
    animation: memory-pulse 0.3s ease-in-out;
}

@keyframes result-fade {
    0% { opacity: 0.3; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes memory-pulse {
    0% { color: white; }
    50% { color: #4CAF50; }
    100% { color: white; }
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 1px;
    padding: 2px;
}

button {
    border: none;
    font-size: 1.25rem;
    padding: 20px 0;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    background-color: #16213e;
    color: white;
    font-weight: 500;
    border-radius: 8px;
    margin: 4px;
    font-family: 'Roboto', sans-serif;
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

button:active {
    transform: scale(0.93);
}

button.clicked {
    transform: scale(0.93);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3) inset;
}

button:hover {
    background-color: #233056;
}

.number {
    background-color: #1e2a4a;
    color: #ffffff;
}

.number:hover {
    background-color: #2d3e69;
}

.operator {
    background-color: #0f3460;
    color: #ffffff;
    font-size: 1.5rem;
}

.operator:hover {
    background-color: #1a4980;
}

.function {
    background-color: #16213e;
    color: #e6e6e6;
}

.function:hover {
    background-color: #233056;
}

button[data-action="equals"] {
    background-color: #0f52ba;
    color: white;
}

button[data-action="equals"]:hover {
    background-color: #1a66d9;
}

button[data-action="clear"],
button[data-action="delete"] {
    background-color: #e94560;
    color: white;
}

button[data-action="clear"]:hover,
button[data-action="delete"]:hover {
    background-color: #f05e77;
}

button[data-action="memory-add"],
button[data-action="memory-recall"] {
    background-color: #533483;
    color: #ffffff;
}

button[data-action="memory-add"]:hover,
button[data-action="memory-recall"]:hover {
    background-color: #6744a0;
}

button[data-action="sqrt"],
button[data-action="square"],
button[data-action="power"],
button[data-action="sin"],
button[data-action="cos"],
button[data-action="tan"],
button[data-action="log"] {
    background-color: #213555;
    color: #ffffff;
    font-size: 1.1rem;
}

button[data-action="sqrt"]:hover,
button[data-action="square"]:hover,
button[data-action="power"]:hover,
button[data-action="sin"]:hover,
button[data-action="cos"]:hover,
button[data-action="tan"]:hover,
button[data-action="log"]:hover {
    background-color: #2d446e;
}

/* Grid layout specifics */
button[data-action="multiply"] {
    grid-column: 4;
    grid-row: 3;
}

button[data-action="subtract"] {
    grid-column: 4;
    grid-row: 4;
}

button[data-action="add"] {
    grid-column: 4;
    grid-row: 5/7;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content sections */
.content-sections {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

section h2 {
    color: #2196F3;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

section p, section ul, section ol {
    margin-bottom: 15px;
}

section ul, section ol {
    padding-left: 20px;
}

section a {
    color: #2196F3;
    text-decoration: none;
}

section a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    color: #777;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: #2196F3;
    text-decoration: none;
    margin: 0 5px;
}

.footer-links a:hover {
    text-decoration: underline;
}

.developer-credit {
    color: #0f52ba;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.developer-credit:hover {
    color: #e94560;
    text-decoration: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .page-container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .content-sections {
        padding: 20px;
    }
    
    section h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 360px) {
    .calculator {
        width: 100%;
        border-radius: 12px;
    }
    
    button {
        padding: 15px 0;
        font-size: 1rem;
    }
} 