/* css/calculator.css */

/* Basic wrapper for the calculator container */
.sc-calculator-wrapper {
    min-height: 600px; 
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, sans-serif;
}

/* The main calculator card */
.sc-calculator-card {
    width: 100%;
    max-width: 1000px;
    margin: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: white;
    /* No transition or dark mode references here if you removed them */
}

/* Typical header styling */
.sc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Title inside the header */
.sc-card-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

/* Content area: history + calculator side by side for bigger screens */
.sc-card-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
}

/* The history section + calculator section “cards” */
.sc-history-section,
.sc-calculator-section {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

/* The main history header */
.sc-history-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sc-history-header h3 {
    margin: 0;
    font-size: 1.2rem;
    margin-right: 1.5rem; /* some space between text & buttons on desktop */
}

.sc-history-buttons {
    display: flex;
    gap: 0.5rem;
}

/* The scrollable list of history entries (desktop default) */
.sc-history-list {
    height: 256px;
    overflow-y: auto;
    background-color: #f1f3f5;
    padding: 0.5rem;
    border-radius: 4px;
}

/* Scrollbar styling */
.sc-history-list::-webkit-scrollbar {
    width: 8px;
}
.sc-history-list::-webkit-scrollbar-track {
    background: transparent;
}
.sc-history-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

/* Each entry in the history list (with copy & dustbin icons) */
.sc-history-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.sc-history-icons {
    display: flex;
    gap: 0.3rem;
}

/* The “icon buttons” for copy & delete */
.sc-icon-button {
    border: none;
    cursor: pointer;
    padding: 0.3rem 0.45rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.sc-icon-button:hover {
    transform: translateY(-1px);
}
.sc-dustbin-button {
    background-color: #f87171;
}
.sc-dustbin-button:hover {
    background-color: #ef4444;
}
.sc-copy-button {
    background-color: #3b82f6;
}
.sc-copy-button:hover {
    background-color: #2563eb;
}

/* Calculator display at the top */
.sc-display {
    background-color: #f1f3f5;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    text-align: right;
    font-size: 1.5rem;
    font-weight: bold;
}

/* The grid of calculator buttons */
.sc-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

/* Generic button styling */
.sc-button {
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    background-color: #e9ecef;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
}
.sc-button:hover {
    background-color: #dee2e6;
    transform: translateY(-1px);
}

/* Special styling for “=”, “C”, etc. */
.sc-button.sc-equals {
    background-color: #22c55e;
    color: white;
}
.sc-button.sc-equals:hover {
    background-color: #16a34a;
}

.sc-button.sc-clear {
    background-color: #ef4444;
    color: white;
}
.sc-button.sc-clear:hover {
    background-color: #dc2626;
}

/* Additional green styling for CSV, TXT, Copy */
.sc-button.sc-green {
    background-color: #22c55e;
    color: white;
}
.sc-button.sc-green:hover {
    background-color: #16a34a;
}

/* A smaller variant for those top history buttons if needed */
.sc-button.sc-small {
    font-size: 0.60rem;
    padding: 0.4rem 0.5rem;
    min-width: 60px;
}

/* 
   MOBILE OVERRIDE
   We use 768px or 1024px depending on your preference.
   You can tweak the exact number if your phone is bigger.
*/
@media (max-width: 768px) {
    .sc-card-content {
        grid-template-columns: 1fr; /* stack vertically */
    }

    /* Reduce padding in the history section */
    .sc-history-section {
        padding: 0.5rem !important;
    }

    .sc-history-header {
        margin-bottom: 0.3rem;
        flex-direction: column;
        align-items: flex-start;
    }
    .sc-history-header h3 {
        margin-right: 0rem; /* no space needed on mobile */
    }
    .sc-history-buttons {
        margin-top: 0.3rem;
    }

    /* Force the history list to 50px height on mobile */
    .sc-history-list {
        height: 50px !important;
        padding: 0.4rem !important;
    }
}

/* 
   If your phone is actually larger, 
   try (max-width: 1024px) to catch bigger screens 
   that still behave like mobile.
*/
