/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #6b6bff;
    --background-color: #1e1e2e;
    --table-bg: #2e2e3e;
    --text-color: #ffffff;
    --hover-color: #ffb86b;
    --button-color: #ff0000; /* Bright Red */
    --button-hover: #cc0000;
    --highlight-green: #00ff00;
}

/* Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-color);
    text-align: center;
    padding: 10px;
    overflow-x: hidden; /* Prevents unwanted horizontal scrolling */
}

/* Main Topic */
.main-topic h1 {
    font-size: 2rem;
    font-weight: 600;
    animation: fadeIn 1s ease-in-out;
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

/* Table Wrapper */
.table-wrapper {
    background: var(--table-bg);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    animation: slideIn 1s ease-in-out;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Ensures table fits within the screen */
}

thead {
    background: var(--primary-color);
    color: var(--text-color);
}

th, td {
    padding: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    word-wrap: break-word; /* Prevents text overflow */
    font-size: 0.9rem;
}

/* Full-Width Input Fields */
td input {
    width: 100%;
    height: 100%;
    padding: 6px;
    border: 2px solid var(--primary-color);
    border-radius: 0; /* Removes border-radius for full fit */
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    text-align: center;
    font-size: 1rem;
    transition: 0.3s ease;
    outline: none;
}

td input:focus {
    border-color: var(--hover-color);
    background: rgba(255, 255, 255, 0.2);
}

/* Difference Table Highlight */
.difference-green {
    background-color: var(--highlight-green);
    color: black;
    font-weight: bold;
}

/* Hover Effect */
tbody tr:hover {
    background: var(--hover-color);
    transition: background 0.3s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 5px;
    }

    .table-wrapper {
        padding: 10px;
    }

    th, td {
        padding: 6px;
        font-size: 0.8rem;
    }

    td input {
        font-size: 0.9rem;
    }

    table {
        table-layout: auto;
    }
}

@media (max-width: 480px) {
    th, td {
        font-size: 0.7rem;
        padding: 4px;
    }

    .main-topic h1 {
        font-size: 1.5rem;
    }
}

/* Reset Button */
.reset-btn {
    background: var(--button-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.5);
    animation: pulse 1.5s infinite alternate;
}

.reset-btn:hover {
    background: var(--button-hover);
    transform: scale(1.05);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.1);
    }
}

/* CSS for Difference Table */
.difference-cell {
    background-color: #32CD32; /* Green for non-zero values */
}

.reset-btn {
    background-color: red;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.reset-btn:hover {
    background-color: darkred;
}

/* Style for individual Reset buttons */
button[data-row] {
    background-color: #ff4d4d; /* Red color for visibility */
    color: white;
    border: none;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s ease-in-out;
}

/* Hover effect */
button[data-row]:hover {
    background-color: #cc0000;
}

/* Style for the main Reset button */
.reset-btn {
    background-color: #ff0000;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s ease-in-out;
}

/* Hover effect for the main reset button */
.reset-btn:hover {
    background-color: #cc0000;
}

input.green-box {
    background-color: green !important;
    color: white !important;
    font-weight: bold;
}
