.awesome-calculator-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #2c3e50; /* Dark blue-grey background */
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 450px; /* Set a max-width for better desktop appearance */
    margin: 20px auto;
    color: #ecf0f1; /* Light text color */
}

.ac-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #34495e; /* Slightly lighter border */
}

.ac-tab-button {
    background-color: transparent;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    color: #bdc3c7; /* Muted tab color */
    transition: color 0.3s, border-bottom 0.3s;
    margin-right: 5px;
    border-bottom: 3px solid transparent;
}

.ac-tab-button.active {
    color: #3498db; /* Active tab color - vibrant blue */
    border-bottom: 3px solid #3498db;
}
.ac-tab-button:hover {
    color: #ecf0f1;
}

.ac-tab-content {
    display: none; /* Hidden by default */
}

.ac-calculator {
    display: flex;
    flex-direction: column;
}

.ac-display-container {
    background-color: #1a252f; /* Darker display background */
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

#ac-expression, #ac-result {
    width: 100%;
    background-color: transparent;
    border: none;
    color: #ecf0f1; /* Light text */
    text-align: right;
    font-size: 20px; /* Smaller expression font */
    box-sizing: border-box;
    padding: 5px 0;
    margin: 0;
}
#ac-result {
    font-size: 28px; /* Larger result font */
    font-weight: bold;
    min-height: 35px; /* Ensure space even when empty */
}
#ac-expression::placeholder {
    color: #7f8c8d;
}

.ac-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* New 5-column layout */
    gap: 10px;
}

.ac-btn {
    background-color: #34495e; /* Darker button color */
    border: none;
    color: #ecf0f1; /* Light text */
    font-size: 18px;
    padding: 18px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0; /* Important for grid item shrinking */
    line-height: 1.2;
}

.ac-btn:hover {
    background-color: #4a6278; /* Lighter shade on hover */
}
.ac-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

.ac-btn-op {
    background-color: #566573; /* Slightly different color for operators */
    color: #ecf0f1;
}
.ac-btn-op:hover {
    background-color: #6c7a89;
}

.ac-btn-equal {
    grid-column: span 2; /* Make equals button span 2 columns */
    background-color: #27ae60;
}
.ac-btn-equal:hover {
    background-color: #2ecc71;
}

.ac-btn-zero {
    grid-column: span 2; /* Make zero button span 2 columns */
}

.ac-btn-op sup {
    font-size: 0.65em;
    margin-left: 1px;
    position: relative;
    top: -0.3em;
}

.ac-info, .ac-graph-info {
    font-size: 0.8em;
    color: #bdc3c7;
    text-align: center;
    margin-top: 10px;
}

/* Graphing Calculator Specific Styles */
.ac-grapher {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ac-graph-controls {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
}
.ac-graph-controls label {
    margin-right: 10px;
    color: #ecf0f1;
    white-space: nowrap;
}
#ac-graph-function-input {
    flex-grow: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #34495e;
    background-color: #1a252f;
    color: #ecf0f1;
    font-size: 14px;
}
.ac-btn-graph {
    padding: 10px 15px;
    margin-left: 10px;
    background-color: #3498db;
}
.ac-btn-graph:hover {
    background-color: #5dade2;
}

#ac-graph-canvas {
    border: 1px solid #34495e;
    border-radius: 8px;
    background-color: #1a252f;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    display: block;
    margin: 0 auto;
}
    
/* Responsive adjustments */
@media (max-width: 480px) {
    .awesome-calculator-container {
        padding: 10px;
        margin: 10px auto;
    }

    .ac-buttons {
        gap: 5px; /* Reduce gap on smaller screens */
    }

    .ac-btn {
        font-size: 14px; /* Reduce font size */
        padding: 12px 4px; /* Reduce padding */
    }
    
    .ac-btn-op sup {
        font-size: 0.6em;
        top: -0.2em;
    }

    #ac-result {
        font-size: 24px;
        min-height: 30px;
    }

    .ac-graph-controls {
        flex-direction: column;
        align-items: stretch;
    }
    #ac-graph-function-input, .ac-btn-graph {
        width: 100%;
        margin-left: 0;
        box-sizing: border-box;
    }
    #ac-graph-function-input {
        margin-bottom: 10px;
    }

    .ac-tab-button {
        font-size: 14px;
        padding: 8px 10px;
    }
}


/* --- Styles for Natural Language Input --- */

.ac-natural-language-container {
    display: flex;
    margin-top: 15px;
    gap: 10px;
}

#ac-nl-query-input {
    flex-grow: 1;
    background-color: #1a252f;
    border: 1px solid #34495e;
    border-radius: 8px;
    padding: 10px 15px;
    color: #ecf0f1;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#ac-nl-query-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.5);
}

#ac-nl-query-input::placeholder {
    color: #7f8c8d;
    opacity: 1;
}

.ac-nl-btn {
    background-color: #3498db;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ac-nl-btn:hover {
    background-color: #5dade2;
}

.ac-nl-btn:disabled {
    background-color: #566573;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Responsive adjustments for the new section */
@media (max-width: 480px) {
    .ac-natural-language-container {
        flex-direction: column;
    }

    .ac-nl-btn {
        width: 100%;
        padding: 12px 10px;
    }
}

/* --- Styles for AI Usage Counter --- */
.ac-usage-counter-wrapper {
    max-width: 490px; /* Match the max-width of the calculator */
    margin: 0 auto 10px auto; /* Centered, with margin below */
}

.ac-usage-counter {
    text-align: center;
    padding: 8px 15px;
    background-color: #1a252f;
    color: #bdc3c7;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #34495e;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: opacity 0.3s;
}

/* --- Styles for Natural Language Input (from previous step) --- */

.ac-natural-language-container {
    display: flex;
    margin-top: 15px;
    gap: 10px;
}

#ac-nl-query-input {
    flex-grow: 1;
    background-color: #1a252f;
    border: 1px solid #34495e;
    border-radius: 8px;
    padding: 10px 15px;
    color: #ecf0f1;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#ac-nl-query-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.5);
}

#ac-nl-query-input::placeholder {
    color: #7f8c8d;
    opacity: 1;
}

.ac-nl-btn {
    background-color: #3498db;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ac-nl-btn:hover {
    background-color: #5dade2;
}

.ac-nl-btn:disabled {
    background-color: #566573;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .ac-natural-language-container {
        flex-direction: column;
    }

    .ac-nl-btn {
        width: 100%;
        padding: 12px 10px;
    }
}