:root {
    --primary-color: #2c3e50;
    --secondary-color: #0099ff;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #2980b9;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* Header */
.site-header {
    background-color: transparent;
    /* background: linear-gradient(135deg, #1a252f, #2c3e50); */
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
}

.logo img {
    height: 40px;
    margin-right: 10px;
    object-fit: cover;
    position: relative;
    top: 5px;
    filter: drop-shadow(0 0 3px rgb(255, 255, 255));
}

.logo a span {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: bolder;
    background: linear-gradient(to right, #aa00ff, #0015ff, #1b9400, #ffae00, #ff0000, #ffae00, #1b9400, #0015ff, #aa00ff);
    background-size: 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: animate-gradient 2.5s linear infinite;
    position: relative;
    top: -3px;
}

@keyframes animate-gradient {
    to {
        background-position: 200%;
    }
}

.logo a {
    text-decoration: none;
    color: white;
}

.nav-links a {
    color: rgba(39, 39, 39, 0.7);
    text-decoration: none;
    margin-left: 20px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: #000000;
}

nav a::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #000000;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

@media (min-width: 350px) and (max-width:390px) {
    .nav-links a {
        margin: 0 0 0 10px;
    }

    .site-header {
        padding: 5px 10px;
    }
}

@media (min-width: 300px) and (max-width:350px) {
    .nav-links a {
        font-size: small;
        margin: 0 0 0 10px;
    }

    .logo {
        gap: 0;
    }

    .logo a span {
        font-size: 1.2rem;
        position: relative;
        top: -5px;
    }

    .site-header {
        padding: 5px 10px;
    }
}



.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    color: #666;
}

.calculator-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
    /* justify-content: center; */
    align-items: center;
}

.input-section,
.results-section {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 800px;
}

.input-section {
    max-width: 500px;
}

.input-section h2,
.results-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border 0.3s;
    min-height: 44px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.form-group .unit {
    position: absolute;
    right: 15px;
    top: 40px;
    color: #777;
    font-weight: bold;
}

.currency-select {
    background-color: white;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1em;
}

.btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    font-weight: 500;
    margin-top: 10px;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    background-color: #007acc;
}

.btn:active {
    transform: scale(0.98);
}

.btn-touch {
    transform: scale(0.95);
    opacity: 0.9;
}

.btn-secondary {
    background-color: rgb(60, 60, 255);
}

.btn-secondary:hover {
    background-color: #d5dbdb;
}

.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: var(--light-color);
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
}

.result-card h3 {
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.big-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.small-text {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

#chart-container {
    margin-top: 30px;
    height: 300px;
}

.tips-section {
    margin-top: 40px;
}

.tips-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tip-card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s;
}

.tip-card:hover {
    transform: translateY(-5px);
}

.tip-card h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

/* Monthly breakdown table styles */
.monthly-breakdown {
    margin-top: 30px;
}

.monthly-breakdown h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.monthly-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.monthly-table th,
.monthly-table td {
    padding: 10px;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

.monthly-table th {
    background-color: var(--light-color);
    text-align: left;
    position: sticky;
    top: 0;
}

.monthly-table tr:hover {
    background-color: #f5f5f5;
}

.table-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

.download-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.error-message {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
}

.input-error {
    border-color: var(--accent-color) !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        margin-bottom: 20px;
        padding: 10px 0;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 1rem;
    }

    .calculator-container {
        flex-direction: column;
        gap: 20px;
    }

    .input-section,
    .results-section {
        padding: 15px;
    }

    .form-group input,
    .form-group select {
        padding: 10px 12px;
    }

    .form-group .unit {
        top: 38px;
    }

    .results {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .big-number {
        font-size: 1.4rem;
    }

    #chart-container {
        height: 40vh;
        min-height: 250px;
    }

    .monthly-table th,
    .monthly-table td {
        padding: 8px 6px;
        font-size: 0.85rem;
    }

    .table-container {
        max-height: 300px;
    }

    .download-buttons {
        flex-direction: column;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .results {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .input-section h2,
    .results-section h2 {
        font-size: 1.3rem;
    }

    .form-group input,
    .form-group select {
        font-size: 0.9rem;
    }

    .form-group {
        display: flex;
        flex-wrap: wrap;
    }

    .form-group label {
        width: 100%;
    }

    .form-group input {
        width: calc(100% - 40px);
        border-radius: var(--border-radius) 0 0 var(--border-radius);
    }

    .form-group .unit {
        position: relative;
        top: auto;
        right: auto;
        width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f0f0f0;
        border: 1px solid #ddd;
        border-left: none;
        border-radius: 0 var(--border-radius) var(--border-radius) 0;
    }

    .monthly-table {
        font-size: 0.8rem;
    }

    .monthly-table th,
    .monthly-table td {
        padding: 6px 4px;
    }
}

/* Prevent zoom on input focus for mobile */
@media screen and (max-width: 768px) {

    input,
    select,
    textarea {
        font-size: 16px;
    }
}

.container {
    overflow-x: hidden;
    /* Prevent horizontal scrolling on the whole page */
    width: 100%;
}

.calculator-container {
    flex-direction: column;
    gap: 20px;
    overflow: visible;
    /* Change from hidden to visible if present */
}

.input-section,
.results-section {
    width: 100%;
    min-width: 0;
    /* Fix flexbox overflow issues */
    box-sizing: border-box;
    overflow: visible;
}

/* Improve form group layout on mobile */
.form-group {
    width: 100%;
}

/* Fix input fields on small screens */
.form-group input,
.form-group select {
    max-width: 100%;
    box-sizing: border-box;
}

/* Adjust results grid for mobile */
.results {
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Make chart container responsive */
#chart-container {
    width: 100%;
    height: auto;
    min-height: 250px;
    max-width: 100%;
}

/* Improve table scrolling */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
}

/* Adjust monthly table for mobile */
.monthly-table {
    min-width: 600px;
    /* Allows horizontal scrolling on small screens */
}

/* More specific mobile adjustments */
@media (max-width: 480px) {
    .form-group input {
        width: 100%;
        border-radius: var(--border-radius);
    }

    .form-group .unit {
        display: none;
        /* Hide units on very small screens */
    }

    .result-card {
        padding: 10px;
    }

    .big-number {
        font-size: 1.4rem;
    }
}

.seo-section {
    max-width: 960px;
    margin: 40px auto;
    padding: 30px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    line-height: 1.8;
    font-size: 1rem;
    color: #212529;
}

.seo-section h2 {
    font-size: 1.8rem;
    color: #4361ee;
    margin-bottom: 20px;
    border-bottom: 2px solid #4361ee;
    padding-bottom: 10px;
}

.seo-section h3 {
    font-size: 1.4rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #3f37c9;
}

.seo-section p {
    margin-bottom: 15px;
}

.seo-section ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 20px;
}

.seo-section ul li {
    margin-bottom: 10px;
}

.seo-section ol {
    list-style: decimal;
    padding-left: 20px;
    margin-bottom: 20px;
}

.seo-section ol li {
    margin-bottom: 10px;
}

.seo-section strong {
    color: #4361ee;
}

.seo-section a {
    color: #3f37c9;
    text-decoration: underline;
}

.seo-section a:hover {
    text-decoration: none;
}

footer {
    margin: 20px;
}

footer p a {
    text-decoration: none;
    font-weight: bold;
}