/* ==========================================================================
   Calculate Mixture Tool Stylesheet - ชัยพฤกษ์เกษตร
   ========================================================================== */

/* Global Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Sarabun", sans-serif;
    background-color: #f9fafb;
    color: #374151;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Utilities & Helpers */
.hidden {
    display: none !important;
}

.max-width-container {
    max-width: 48rem;
    /* 768px */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Header Section */
.app-header {
    background: linear-gradient(135deg, #16a34a, #047857);
    color: #ffffff;
    text-align: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: 0.025em;
}

.app-header p {
    color: #d1fae5;
    font-size: 0.875rem;
    font-weight: 300;
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #16a34a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #15803d;
}

.hint-text {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 300;
}

/* Main Grid Layout */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Form Container Card */
.input-card {
    background-color: #ffffff;
    border-radius: 1rem;
    border: 1px solid #f3f4f6;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title .status {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
}

/* Form Fields */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.form-label-highlight {
    color: #065f46;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Inputs & Selects */
.input-control {
    width: 100%;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: #1f2937;
    font-size: 1rem;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    transition: all 0.2s ease;
}

.input-control:focus {
    outline: none;
    border-color: #10b981;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-control-brand {
    background-color: rgba(209, 250, 229, 0.3);
    border-color: #a7f3d0;
    font-weight: 500;
}

.input-control-brand::placeholder {
    color: #9ca3af;
}

.input-control-bold {
    font-weight: 700;
}

/* Input Containers with Badges */
.input-with-badge {
    position: relative;
}

.input-with-badge .input-control {
    padding-right: 4.5rem;
}

.input-badge {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: none;
}

.sub-info {
    font-size: 0.75rem;
    color: #9ca3af;
    padding-left: 0.25rem;
    margin-top: 0.375rem;
}

.sub-info span {
    font-weight: 600;
    color: #4b5563;
}

.custom-input-wrapper {
    margin-top: 0.5rem;
}

/* Sidebar & Results Panel */
.results-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-result-card {
    background: linear-gradient(135deg, #16a34a, #047857);
    color: #ffffff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.hero-result-card .badge-title {
    font-size: 0.75rem;
    color: #a7f3d0;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.hero-result-card .desc {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.hero-result-card .desc span {
    font-weight: 700;
}

.hero-result-card .value-display {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.hero-result-card .main-value {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.hero-result-card .unit {
    font-size: 1.125rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Summary Details Card */
.summary-card {
    background-color: #ffffff;
    border-radius: 1rem;
    border: 1px solid #f3f4f6;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.summary-header {
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
}

.summary-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-chem-name {
    font-size: 1rem;
    font-weight: 800;
    color: #047857;
    margin-top: 0.25rem;
    word-break: break-all;
}

.summary-row {
    margin-bottom: 1rem;
}

.summary-row:last-of-type {
    margin-bottom: 1.25rem;
}

.summary-row .label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.125rem;
}

.summary-row .value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1f2937;
}

/* Suggestion Box Inside Summary */
.suggestion-box {
    background-color: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.suggestion-box .title {
    font-size: 0.75rem;
    color: #065f46;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.suggestion-box .total-bottles {
    font-size: 1.875rem;
    font-weight: 900;
    color: #047857;
}

.suggestion-box .total-bottles span {
    font-size: 1rem;
    font-weight: 700;
    color: #10b981;
}

.suggestion-box .leftover {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Footer Section */
.app-footer {
    background-color: #1f2937;
    color: #9ca3af;
    text-align: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-size: 0.75rem;
    border-top: 1px solid #374151;
}

/* Responsive Breakpoints */
@media (min-width: 768px) {
    .app-header h1 {
        font-size: 1.875rem;
    }

    .tool-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .input-card {
        grid-column: span 3 / span 3;
    }

    .results-sidebar {
        grid-column: span 2 / span 2;
    }
}