/**
 * Pregnancy Calculator - Dr Tool UI Design
 * Complete CSS - Header inside card border
 * Follows global color system: Primary #0e7e94, white background
 */

/* Calculator Container */
.pregnancy-calculator-modern {
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: transparent;
    box-sizing: border-box;
}

.drtool-box {
    background: transparent;
    border: none;
    padding: 0;
}

* {
    box-sizing: border-box;
}

/* Main Card - White background with teal border - WRAPS EVERYTHING (including header) */
.modern-calculator-card {
    background: #ffffff !important;
    border-radius: 10px;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Header Section - NOW INSIDE THE CARD */
.modern-header {
    text-align: center;
    padding: 28px 28px 0 28px;
    background: #ffffff !important;
    border-bottom: none;
}

.modern-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0b1120 !important;
    margin: 0 0 8px;
    line-height: 1.2;
    font-family: 'Manrope', sans-serif;
}

.modern-description {
    font-size: 0.95rem;
    color: #4b5563 !important;
    margin: 0;
    font-family: 'Manrope', sans-serif;
}

/* Calculator Wrapper - Now directly under header */
.calculator-wrapper {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
}

/* Input Area */
.input-area {
    flex: 1;
    min-width: 280px;
    padding: 28px;
    background: #ffffff !important;
    border-right: 1px solid #e5e7eb;
}

.input-group {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-weight: 600;
    color: #374151 !important;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-family: 'Manrope', sans-serif;
}

/* Input Fields */
.modern-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px;
    font-size: 0.9375rem;
    transition: all 0.2s;
    background: #ffffff !important;
    color: #111827 !important;
    font-family: 'Manrope', sans-serif;
}

.modern-input:focus {
    outline: none;
    border-color: #0a6475 !important;
    box-shadow: 0 0 0 3px rgba(14, 126, 148, 0.1);
}

.modern-input:hover {
    border-color: #0e7e94 !important;
}

/* Date Input Styling */
.modern-input[type="date"] {
    position: relative;
    cursor: pointer;
}

.modern-input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    color: #0e7e94;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.modern-input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background: #e8f2f4;
}

/* Cycle Length Input with Unit */
.cycle-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cycle-input {
    padding-right: 60px;
}

.cycle-unit {
    position: absolute;
    right: 14px;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.85rem;
    pointer-events: none;
    background: #ffffff;
    padding: 0 4px;
}

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.7rem;
    color: #6b7280 !important;
    font-family: 'Manrope', sans-serif;
}

/* Button Group */
.button-group-modern {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
}

/* Primary Button - Dr Tool Global Style */
.modern-btn {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Manrope', sans-serif;
    text-align: center;
}

.primary-btn {
    background: #0e7e94 !important;
    color: #ffffff !important;
}

.primary-btn:hover {
    background: #0a6475 !important;
    transform: translateY(-1px);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Secondary Button */
.secondary-btn {
    background: #e8f2f4 !important;
    color: #0e7e94 !important;
    border: 1px solid #dbe4ea !important;
}

.secondary-btn:hover {
    background: #0e7e94 !important;
    color: #ffffff !important;
    border-color: #0e7e94 !important;
}

/* Results Area */
.results-area {
    flex: 1;
    min-width: 280px;
    padding: 28px;
    background: #ffffff !important;
}

.results-header {
    margin-bottom: 24px;
    text-align: center;
}

.results-badge {
    display: inline-block;
    padding: 4px 14px;
    background: #e8f2f4 !important;
    color: #0e7e94 !important;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
}

/* Results Grid */
.results-grid-modern {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.result-item {
    padding: 16px 18px;
    background: #f8fafc !important;
    border-radius: 10px;
    border: 1px solid #e5e7eb !important;
    transition: all 0.2s ease;
}

.result-item:hover {
    border-color: #0e7e94 !important;
    background: #ffffff !important;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280 !important;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
}

.result-value-large {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0e7e94 !important;
    line-height: 1.3;
    word-break: break-word;
    font-family: 'Manrope', sans-serif;
}

.result-sub {
    font-size: 0.7rem;
    color: #6b7280 !important;
    font-family: 'Manrope', sans-serif;
}

/* Progress Tracker */
.progress-tracker {
    margin: 24px 0;
    padding: 18px;
    background: #f8fafc !important;
    border-radius: 10px;
    border: 1px solid #e5e7eb !important;
}

.tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 6px;
}

.tracker-title {
    font-weight: 600;
    color: #374151 !important;
    font-size: 0.875rem;
    font-family: 'Manrope', sans-serif;
}

.tracker-percent {
    font-size: 0.8rem;
    color: #0e7e94 !important;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
}

.progress-bar-container {
    height: 6px;
    background: #e5e7eb !important;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: #0e7e94 !important;
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 0%;
}

/* Progress Milestones - Increased font size */
.progress-milestones {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.progress-milestones span {
    font-size: 0.8rem !important;
    font-weight: 500;
    color: #4b5563 !important;
    font-family: 'Manrope', sans-serif;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Disclaimer */
.disclaimer-modern {
    margin-top: 24px;
    padding: 14px 16px;
    background: #f8fafc !important;
    border-radius: 10px;
    border-left: 3px solid #0e7e94 !important;
}

.disclaimer-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.disclaimer-content strong {
    font-size: 0.75rem;
    color: #374151 !important;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
}

.disclaimer-content span {
    font-size: 0.7rem;
    color: #6b7280 !important;
    line-height: 1.4;
    font-family: 'Manrope', sans-serif;
}

/* Error Message */
.error-message-modern {
    margin-top: 20px;
    padding: 14px 18px;
    background: #fef2f2 !important;
    border-left: 3px solid #dc2626 !important;
    border-radius: 10px;
    color: #991b1b !important;
    font-size: 0.8rem;
    line-height: 1.4;
    font-family: 'Manrope', sans-serif;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-area {
    animation: fadeInUp 0.3s ease-out;
}

/* ============================================ */
/* TABLET VIEW (768px to 1024px) */
/* ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .pregnancy-calculator-modern {
        max-width: 95%;
    }
    
    .modern-title {
        font-size: 1.8rem;
    }
    
    .input-area, .results-area {
        padding: 24px;
    }
    
    .result-value-large {
        font-size: 1.25rem;
    }
    
    .modern-input {
        padding: 10px 14px;
    }
    
    .progress-milestones span {
        font-size: 0.75rem !important;
        padding: 3px 6px;
    }
    
    .modern-header {
        padding: 24px 24px 0 24px;
    }
}

/* ============================================ */
/* MOBILE VIEW (up to 767px) */
/* ============================================ */
@media (max-width: 767px) {
    .calculator-wrapper {
        flex-direction: column;
    }
    
    .input-area {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .pregnancy-calculator-modern {
        padding: 0;
    }
    
    .modern-title {
        font-size: 1.6rem;
    }
    
    .modern-description {
        font-size: 0.85rem;
    }
    
    .input-area, .results-area {
        padding: 20px;
    }
    
    .result-value-large {
        font-size: 1.2rem;
    }
    
    .cycle-unit {
        right: 10px;
        font-size: 0.75rem;
    }
    
    .modern-btn {
        padding: 10px 20px;
    }
    
    .progress-milestones {
        gap: 6px;
    }
    
    .progress-milestones span {
        font-size: 0.7rem !important;
        padding: 3px 6px;
    }
    
    .modern-header {
        padding: 20px 20px 0 20px;
    }
}

/* ============================================ */
/* SMALL MOBILE VIEW (up to 480px) */
/* ============================================ */
@media (max-width: 480px) {
    .modern-title {
        font-size: 1.4rem;
    }
    
    .input-area, .results-area {
        padding: 16px;
    }
    
    .result-item {
        padding: 12px 14px;
    }
    
    .result-value-large {
        font-size: 1.1rem;
    }
    
    .tracker-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modern-input {
        padding: 10px 12px;
        font-size: 0.875rem;
    }
    
    .progress-milestones {
        gap: 5px;
        justify-content: center;
    }
    
    .progress-milestones span {
        font-size: 0.65rem !important;
        padding: 3px 5px;
    }
    
    .modern-header {
        padding: 16px 16px 0 16px;
    }
}

/* Extra Small Mobile (up to 380px) */
@media (max-width: 380px) {
    .progress-milestones span {
        font-size: 0.6rem !important;
        padding: 2px 4px;
    }
    
    .modern-header {
        padding: 12px 12px 0 12px;
    }
}

/* Print Styles */
@media print {
    .pregnancy-calculator-modern {
        background: white;
        padding: 0;
    }
    .modern-btn {
        display: none;
    }
    .modern-calculator-card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}