/**
 * Anacoder Calculators - Frontend Styles
 * Lightweight, Modern, Responsive Design System
 */

.ac-calc-card {
    max-width: 580px;
    margin: 24px auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #1e293b;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.ac-calc-card *, .ac-calc-card *:before, .ac-calc-card *:after {
    box-sizing: border-box;
}

.ac-calc-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ac-calc-icon {
    font-size: 24px;
    line-height: 1;
}

.ac-calc-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.ac-calc-body {
    padding: 24px;
}

.ac-calc-desc {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #64748b;
}

/* Form Controls */
.ac-form-group {
    margin-bottom: 16px;
}

.ac-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.ac-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 500px) {
    .ac-form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.ac-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    color: #0f172a;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
}

.ac-input:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select.ac-input {
    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='%2364748b' 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 12px center;
    background-size: 16px;
    padding-right: 36px;
    cursor: pointer;
}

/* Unit Toggle */
.ac-unit-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.ac-toggle-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ac-toggle-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* Buttons */
.ac-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 18px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ac-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.ac-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.ac-btn-outline {
    background: #ffffff;
    border: 1.5px dashed #94a3b8;
    color: #334155;
    font-size: 0.875rem;
    padding: 8px 14px;
}

.ac-btn-outline:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

/* Results Display */
.ac-calc-results {
    margin-top: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
}

.ac-result-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ac-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 8px;
}

.ac-result-item.ac-highlight {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}

.ac-result-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
}

.ac-result-item.ac-highlight .ac-result-label {
    color: #1e40af;
    font-weight: 600;
}

.ac-result-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.ac-result-item.ac-highlight .ac-result-value {
    font-size: 1.25rem;
    color: #1d4ed8;
}

/* Category Badges */
.ac-badge-normal {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #dcfce7;
    color: #166534;
    border-radius: 6px;
}

/* BMI Scale Bar */
.ac-bmi-scale-bar {
    position: relative;
    height: 10px;
    background: linear-gradient(to right, #60a5fa 0%, #4ade80 25%, #fbbf24 60%, #f87171 100%);
    border-radius: 5px;
    margin-top: 14px;
}

.ac-bmi-marker {
    position: absolute;
    top: -5px;
    width: 6px;
    height: 20px;
    background: #0f172a;
    border: 2px solid #ffffff;
    border-radius: 3px;
    transform: translateX(-50%);
    transition: left 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* CGPA Courses Table */
.ac-courses-table-wrap {
    margin-top: 14px;
}

.ac-courses-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 30px;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding: 0 4px;
}

.ac-course-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 30px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.ac-btn-remove-row {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.ac-btn-remove-row:hover {
    color: #b91c1c;
}

/* GPA Rows */
.ac-gpa-row {
    display: grid;
    grid-template-columns: 100px 1fr 90px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.ac-gpa-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

/* Credit Badge Footer */
.ac-calc-credit {
    padding: 10px 24px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    text-align: right;
    font-size: 0.75rem;
    color: #94a3b8;
}

.ac-calc-credit a {
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.ac-calc-credit a:hover {
    color: #2563eb;
    text-decoration: underline;
}



