/* קובץ: css/clc_units.css */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Heebo', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
}

/* כותרת ראשית */
.main-header {
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #198754 0%, #0f6b3f 100%);
    color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(25, 135, 84, 0.2);
}

.main-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.main-header p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

/* מיכל מחשבונים */
.converter-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    padding: 1rem;
}

/* קלף מחשבון */
.converter-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.converter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    border-color: #198754;
}

.converter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #198754, #0d6efd);
}

.converter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.converter-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
}

.converter-name i {
    color: #198754;
    font-size: 1.6rem;
}

/* טופס המרה */
.converter-form {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.1);
}

.unit {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* כפתורי המרה */
.convert-btn-container {
    display: flex;
    justify-content: center;
}

.convert-btn {
    background: linear-gradient(135deg, #198754 0%, #0f6b3f 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.4);
}

.convert-btn:active {
    transform: translateY(0);
}

/* הצגת תוצאות */
.result-display {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    text-align: center;
    border: 2px solid #dee2e6;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.result-display.show {
    opacity: 1;
    transform: translateY(0);
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #198754;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

#dose-result-text,
#weight-result-text,
#temp-result-text,
#bsa-result-text,
#dose-calc-result-text {
    font-size: 1.1rem;
    color: #495057;
}

/* כפתורי נוסחאות */
.formula-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.formula-btn {
    padding: 10px 20px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    flex: 1;
    min-width: 120px;
}

.formula-btn:hover {
    border-color: #198754;
    color: #198754;
}

.formula-btn.active {
    background: linear-gradient(135deg, #198754 0%, #0f6b3f 100%);
    color: white;
    border-color: #198754;
}

/* טבלאות */
.section-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 2.5rem 0 1.5rem;
    padding-bottom: 15px;
    border-bottom: 3px solid #198754;
    display: flex;
    align-items: center;
    gap: 15px;
}

.conversion-table {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.conversion-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.conversion-table th {
    background: linear-gradient(135deg, #198754 0%, #0f6b3f 100%);
    color: white;
    padding: 15px;
    text-align: right;
    font-weight: 600;
}

.conversion-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    text-align: right;
}

.conversion-table tr:hover {
    background-color: #f8f9fa;
}

.conversion-table tr:last-child td {
    border-bottom: none;
}

/* כפתורי פעולה */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 150px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #198754 0%, #0f6b3f 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #20c997 0%, #199d76 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(32, 201, 151, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* כפתורי שיתוף */
.share-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 2rem 0;
}

.share-btn-small {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.share-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #1da851 100%);
    color: white;
}

.share-email {
    background: linear-gradient(135deg, #EA4335 0%, #c23325 100%);
    color: white;
}

.share-copy {
    background: linear-gradient(135deg, #6f42c1 0%, #5936a3 100%);
    color: white;
}

.share-print {
    background: linear-gradient(135deg, #fd7e14 0%, #e06c10 100%);
    color: white;
}

.share-btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* אזור מידע */
.info-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-top: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.info-title {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 15px;
    border-bottom: 3px solid #198754;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-section h4 {
    color: #198754;
    margin: 1.5rem 0 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-section ul {
    list-style: none;
    padding-right: 20px;
    margin-bottom: 1.5rem;
}

.info-section li {
    margin-bottom: 10px;
    padding-right: 30px;
    position: relative;
}

.info-section li:before {
    content: '✓';
    position: absolute;
    right: 0;
    color: #198754;
    font-weight: bold;
}

.info-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* מודל שיתוף */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* עיצוב לתוכן נוסחה */
.bsa-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* מדבקת התראה */
.alert-badge {
    display: inline-block;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 10px;
}

/* אנימציות */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* רספונסיביות */
@media (max-width: 992px) {
    .converter-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .convert-btn-container {
        grid-column: 1;
    }
    
    .bsa-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .converter-container {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    
    .converter-card {
        padding: 20px;
    }
    
    .converter-name {
        font-size: 1.2rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .formula-selector {
        flex-direction: column;
    }
    
    .formula-btn {
        width: 100%;
    }
    
    .share-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }
    
    .main-header h1 {
        font-size: 1.7rem;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .share-options {
        grid-template-columns: 1fr;
    }
    
    .conversion-table {
        padding: 15px;
    }
    
    .conversion-table th,
    .conversion-table td {
        padding: 10px 5px;
        font-size: 0.9rem;
    }
}

/* כפתור גלילה למעלה */
.scroll-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #198754 0%, #0f6b3f 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: none;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 20px rgba(25, 135, 84, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(25, 135, 84, 0.6);
}

/* הדגשת שדות חובה */
.required::after {
    content: ' *';
    color: #dc3545;
}

/* סגנונות מדיה נוספות להדפסה */
@media print {
    .no-print,
    .scroll-top,
    .action-buttons,
    .share-options {
        display: none !important;
    }
    
    .converter-card {
        break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    .main-header {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}