/* Computation Page Specific Styles */

/* Active navigation link */
.nav-menu a.active {
    color: var(--primary-green);
}

.nav-menu a.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Computation Hero Section */
.computation-hero {
    background: var(--gradient-bg);
    padding: 120px 0 80px 0;
    text-align: center;
    color: var(--white);
    position: relative;
}

.computation-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(46, 59, 127, 0.9) 0%, rgba(59, 79, 160, 0.8) 100%);
    z-index: 0;
}

.computation-hero .container {
    position: relative;
    z-index: 1;
}

.computation-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.computation-hero p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Computation Tool Section */
.computation-tool {
    padding: 4rem 0;
    background: var(--light-grey);
}

.tool-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Panel Styles */
.panel {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.panel h3 {
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-green);
}

/* Input Panel */
.input-panel {
    height: fit-content;
}

.form-grid {
    display: grid;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(95, 158, 124, 0.1);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Button Group */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-swap {
    background: var(--accent-green);
    color: var(--white);
    border: none;
}

.btn-swap:hover {
    background: #3a6449;
    transform: translateY(-2px);
}

.btn-copy {
    background: var(--accent-green);
    color: var(--white);
    border: none;
}

.btn-copy:hover {
    background: #3a6449;
}

.btn-clear {
    background: var(--medium-grey);
    color: var(--text-dark);
    border: none;
}

.btn-clear:hover {
    background: #d1d5db;
}

/* Footnote */
.footnote {
    font-size: 0.85rem;
    color: var(--dark-grey);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Results Panel */
.results-panel {
    display: flex;
    flex-direction: column;
}

.result-display {
    margin-bottom: 1.5rem;
}

.result-display label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    display: block;
    font-size: 1rem;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-green);
    padding: 1.5rem;
    background: var(--light-grey);
    border-radius: 10px;
    min-height: 80px;
    display: flex;
    align-items: center;
    word-break: break-word;
}

/* History Section */
.history-section {
    margin-top: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.history-section label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.history-table {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.history-header {
    display: grid;
    grid-template-columns: 80px 110px 180px 1fr;
    background: #f3f4f6;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    border-bottom: 2px solid #e5e7eb;
}

.history-body {
    flex: 1;
    overflow-y: auto;
    background: var(--white);
}

.history-row {
    display: grid;
    grid-template-columns: 80px 110px 180px 1fr;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.history-row:hover {
    background: #f9fafb;
}

.history-row > div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scrollbar styling */
.history-body::-webkit-scrollbar {
    width: 8px;
}

.history-body::-webkit-scrollbar-track {
    background: var(--light-grey);
}

.history-body::-webkit-scrollbar-thumb {
    background: var(--medium-grey);
    border-radius: 4px;
}

.history-body::-webkit-scrollbar-thumb:hover {
    background: var(--dark-grey);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tool-wrapper {
        grid-template-columns: 1fr;
    }

    .history-header,
    .history-row {
        grid-template-columns: 70px 100px 150px 1fr;
        font-size: 0.85rem;
    }

    .history-table {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--white);
        flex-direction: column;
        padding: 2rem 0;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 0;
        padding: 0;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }

    .nav-menu a::after {
        display: none;
    }

    .computation-hero h1 {
        font-size: 2rem;
    }

    .computation-hero p {
        font-size: 1rem;
    }

    .panel {
        padding: 1.5rem;
    }

    .result-value {
        font-size: 1.5rem;
        padding: 1rem;
        min-height: 60px;
    }

    .history-header,
    .history-row {
        grid-template-columns: 60px 80px 120px 1fr;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .button-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .computation-hero {
        padding: 100px 0 60px 0;
    }

    .computation-hero h1 {
        font-size: 1.75rem;
    }

    .computation-hero p {
        font-size: 0.9rem;
    }

    .panel h3 {
        font-size: 1.25rem;
    }

    .history-header {
        display: none;
    }

    .history-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        padding: 0.75rem;
    }

    .history-row > div:before {
        font-weight: 600;
        margin-right: 0.5rem;
    }

    .history-row > div:nth-child(1):before {
        content: 'Time: ';
    }

    .history-row > div:nth-child(2):before {
        content: 'Category: ';
    }

    .history-row > div:nth-child(3):before {
        content: 'Conversion: ';
    }

    .history-row > div:nth-child(4):before {
        content: 'Result: ';
    }
}

/* Loading/Processing Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.processing {
    animation: shimmer 2s infinite;
    background: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-size: 1000px 100%;
}
