:root {
    --primary-color: #4285F4;
    --secondary-color: #f1f1f1;
    --text-color: #333;
    --button-hover: #3367d6;
    --display-bg: #fff;
    --operator-color: #f1f1f1;
    --equals-color: #4285F4;
    --equals-hover: #3367d6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.calculator-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.calculator-container {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.display {
    background: var(--display-bg);
    padding: 1.5rem;
    text-align: right;
    border-bottom: 1px solid var(--secondary-color);
}

.memory-indicator {
    min-height: 1.5rem;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.current-input {
    font-size: 2rem;
    font-weight: 500;
    word-wrap: break-word;
    word-break: break-all;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 1rem;
}

button {
    border: none;
    background: var(--secondary-color);
    padding: 1rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 5px;
}

button:hover {
    background-color: #e0e0e0;
}

.memory-btn {
    background-color: #e0e0e0;
    font-size: 0.9rem;
}

.operator-btn {
    background-color: var(--operator-color);
    font-weight: 500;
}

.equals-btn {
    background-color: var(--equals-color);
    color: white;
}

.equals-btn:hover {
    background-color: var(--equals-hover);
}

.zero {
    grid-column: span 2;
}

/* Percentage Calculator Styles */
.percentage .input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.percentage .input-group input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.percentage-buttons {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

/* Fraction Calculator Styles */
.calculator-container.fraction {
    max-width: 600px;
    padding: 2rem;
}

.fraction-input-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.fraction-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.fraction-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.fraction-input-field {
    width: 100px;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    transition: border-color 0.3s;
}

.fraction-input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.fraction-line {
    width: 100px;
    height: 2px;
    background-color: #333;
    margin: 0.5rem 0;
}

.fraction-operator {
    padding: 0.8rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.2rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.fraction-operator:focus {
    outline: none;
    border-color: var(--primary-color);
}

.fraction-result-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.equals-sign {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.fraction-result-wrapper {
    min-width: 100px;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.fraction-result {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-color);
}

.fraction-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.fraction-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.calculate-btn {
    background-color: var(--primary-color);
    color: white;
}

.calculate-btn:hover {
    background-color: var(--button-hover);
}

.simplify-btn {
    background-color: #4CAF50;
    color: white;
}

.simplify-btn:hover {
    background-color: #45a049;
}

.clear-btn {
    background-color: #f44336;
    color: white;
}

.clear-btn:hover {
    background-color: #d32f2f;
}

.btn-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

@media (max-width: 768px) {
    .fraction-input-group {
        flex-direction: column;
    }

    .fraction-result-container {
        flex-direction: column;
    }

    .fraction-buttons {
        flex-direction: column;
    }

    .fraction-btn {
        width: 100%;
        justify-content: center;
    }
}

/* GPA Calculator Styles */
.gpa-input {
    padding: 1rem;
}

.course-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.course-row input,
.course-row select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.add-course {
    width: 100%;
    margin: 1rem 0;
    background-color: var(--primary-color);
    color: white;
}

.gpa-buttons {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

/* Result Styles */
.result {
    padding: 1rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
}

footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .calculator-container {
        max-width: 100%;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
} 