/* DEBUG: CSS loaded v2.0.1 */
.calorie-calculator-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 40px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.calorie-calculator-form {
    background: rgba(255, 255, 255, 0.98);
    padding: 50px;
    border-radius: 20px;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Mobile specific styles for form without container */
@media (max-width: 768px) {
    .calorie-calculator-form {
        max-width: 100%;
        width: 100%;
        margin: 20px auto;
        padding: 30px 20px;
        border-radius: 15px;
    }
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.calculator-section {
    margin-bottom: 40px;
    padding: 35px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.calculator-section:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}

.calculator-section h3 {
    margin: 0 0 30px 0;
    color: #1e293b;
    font-size: 1.5em;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #6366f1, #8b5cf6) 1;
    position: relative;
    letter-spacing: -0.025em;
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #1f2937;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.form-group .required {
    color: #e74c3c;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: start;
}

/* Force single column on all mobile devices */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .form-group.half {
        width: 100% !important;
        max-width: none !important;
        margin-bottom: 20px;
    }
    
    /* Ensure all inputs are full width on mobile */
    input[type="number"],
    input[type="text"],
    select {
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .input-with-unit {
        width: 100% !important;
        display: flex !important;
    }
    
    .input-with-unit input {
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .input-with-unit select {
        flex-shrink: 0 !important;
        width: auto !important;
        min-width: 70px !important;
    }
}

@media (max-width: 768px) {
    .calorie-calculator-container {
        padding: 20px 15px;
        margin: 100px 0 12px 0;
        max-width: 100%;
        width: 100%;
        border-radius: 15px;
    }
}

/* Tall mobile screens (Samsung S24 Ultra, iPhone Pro Max, Pixel Pro 9, etc.) */
@media (max-width: 768px) and (min-height: 900px) {
    .calorie-calculator-container {
        margin-top: 160px;
    }
}

/* Pixel Pro 9 specific (480px x 1080px and similar) */
@media (min-width: 390px) and (max-width: 480px) and (min-height: 800px) {
    .calorie-calculator-container {
        margin-top: 140px;
    }
}

/* Extra tall mobile screens */
@media (max-width: 768px) and (min-height: 1000px) {
    .calorie-calculator-container {
        margin-top: 180px;
    }
}

/* Samsung S24 Ultra specific (428px x 926px) - Expand 30% more */
@media (min-width: 400px) and (max-width: 450px) and (min-height: 900px) {
    .calorie-calculator-container {
        max-width: 130%;
        width: 130%;
        margin-left: -15%;
        margin-right: -15%;
        padding: 25px 20px;
    }
}

/* Additional responsive breakpoints for specific devices */
/* Samsung Galaxy and Pixel specific fixes */
@media (max-width: 480px), (min-width: 360px) and (max-width: 450px) {
    .calorie-calculator-container {
        padding: 20px 15px !important;
        margin: 100px 8px 15px 8px !important;
    }
    
    .calorie-calculator-form {
        padding: 25px 20px !important;
    }
    
    .calculator-section {
        padding: 25px !important;
        margin-bottom: 25px !important;
    }
    
    .form-row {
        display: block !important;
        grid-template-columns: none !important;
        margin-bottom: 25px !important;
    }
    
    .form-group {
        margin-bottom: 25px !important;
    }
    
    .form-group.half {
        display: block !important;
        width: 100% !important;
        margin-bottom: 25px !important;
    }
    
    .form-group label {
        margin-bottom: 12px !important;
        font-size: 16px !important;
    }
    
    input[type="number"],
    input[type="text"],
    select {
        padding: 20px 18px !important;
        min-height: 56px !important;
        margin-bottom: 5px !important;
    }
    
    .input-with-unit {
        margin-bottom: 5px !important;
    }
    
    .input-with-unit input {
        padding: 20px 18px !important;
    }
    
    .input-with-unit select {
        padding: 20px 16px !important;
        min-width: 85px !important;
    }
    
    .radio-group {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
        margin-top: 15px !important;
    }
    
    .radio-label {
        padding: 20px 24px !important;
        min-height: 60px !important;
    }
    
    .calculate-button {
        padding: 22px 30px !important;
        min-height: 64px !important;
        margin-top: 15px !important;
    }
}

/* Small mobile phones (iPhone SE, small Android) */
@media (max-width: 480px) {
    .calorie-calculator-container {
        padding: 15px 8px;
        margin: 80px 5px 10px 5px;
        border-radius: 12px;
    }
    
    .calorie-calculator-form {
        padding: 20px 16px;
        border-radius: 10px;
    }
    
    .calculator-section {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 8px;
    }
    
    .calculator-section h3 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    input[type="number"],
    input[type="text"],
    select {
        font-size: 16px;
        padding: 18px 20px;
        min-height: 52px;
        border-radius: 10px;
    }
    
    .input-with-unit {
        border-radius: 10px;
    }
    
    .input-with-unit input {
        padding: 18px 20px;
        font-size: 16px;
    }
    
    .input-with-unit select {
        padding: 18px 16px;
        font-size: 15px;
        min-width: 80px;
    }
    
    .radio-label {
        padding: 16px 20px;
        min-height: 54px;
        font-size: 15px;
        border-radius: 10px;
    }
    
    .radio-label input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }
    
    .calculate-button {
        font-size: 17px;
        padding: 20px 36px;
        min-height: 60px;
        border-radius: 14px;
        width: 100%;
    }
}

/* Medium mobile devices (Pixel Pro 9, iPhone 14/15 Pro) */
@media (min-width: 481px) and (max-width: 768px) {
    .calorie-calculator-container {
        padding: 20px 12px;
        margin: 100px 8px 15px 8px;
        border-radius: 15px;
    }
    
    .calorie-calculator-form {
        padding: 25px 20px;
        border-radius: 12px;
    }
    
    .calculator-section {
        padding: 22px;
        margin-bottom: 22px;
        border-radius: 10px;
    }
    
    .calculator-section h3 {
        font-size: 1.4em;
        margin-bottom: 25px;
        font-weight: 700;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .form-group {
        margin-bottom: 25px;
    }
    
    .form-group label {
        font-size: 16px;
        margin-bottom: 10px;
        font-weight: 600;
    }
    
    input[type="number"],
    input[type="text"],
    select {
        font-size: 16px;
        padding: 18px 20px;
        min-height: 54px;
        border-radius: 12px;
    }
    
    .input-with-unit {
        border-radius: 12px;
    }
    
    .input-with-unit input {
        padding: 18px 20px;
        font-size: 16px;
        min-width: 110px;
    }
    
    .input-with-unit select {
        padding: 18px 16px;
        font-size: 15px;
        min-width: 82px;
    }
    
    .radio-label {
        padding: 17px 22px;
        min-height: 56px;
        font-size: 15px;
        border-radius: 12px;
    }
    
    .radio-label input[type="radio"] {
        width: 21px;
        height: 21px;
        margin-right: 14px;
    }
    
    .calculate-button {
        font-size: 17px;
        padding: 20px 38px;
        min-height: 62px;
        border-radius: 15px;
        margin-top: 8px;
        width: 100%;
    }
}

.form-group.half {
    width: 100%;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    min-height: 44px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
}

select:focus {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%233498db" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    transform: translateY(-1px);
}

input[type="number"]:hover,
input[type="text"]:hover,
select:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.input-with-unit {
    display: flex;
    gap: 0;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.input-with-unit:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    transform: translateY(-1px);
}

.input-with-unit:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.input-with-unit input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 15px;
    background: transparent;
    outline: none;
    font-family: inherit;
    min-width: 100px;
    font-weight: 500;
}

.input-with-unit select {
    border: none;
    border-left: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 14px 12px;
    font-size: 14px;
    color: #475569;
    min-width: 70px;
    outline: none;
    font-family: inherit;
    font-weight: 500;
}

.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .radio-group {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-top: 12px;
    }
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    font-weight: 500;
    position: relative;
    min-height: 45px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    font-size: 14px;
}

.radio-label:hover {
    border-color: #6366f1;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.15);
}

.radio-label input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    transform: scale(1.0);
}

.radio-label input[type="radio"]:checked + span,
.radio-label:has(input[type="radio"]:checked) {
    border-color: #6366f1;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4338ca;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.required {
    color: #ef4444;
    font-weight: 600;
}

.form-group.half {
    margin-bottom: 0;
}

.calculate-button {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    color: white;
    border: none;
    padding: 20px 50px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    border: 2px solid transparent;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    min-height: 56px;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.calculate-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.calculate-button:active {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.calculate-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
    animation: none;
}

.calculator-loading {
    text-align: center;
    padding: 30px 20px;
    color: #7f8c8d;
    background: #fff;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.spinner {
    border: 3px solid #ecf0f1;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.calculator-errors {
    background: linear-gradient(135deg, #ffeaea 0%, #ffe0e0 100%);
    border: 2px solid #e74c3c;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    color: #c0392b;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
    font-weight: 500;
}

.calculator-errors ul {
    margin: 0;
    padding-left: 20px;
}

.calculator-errors li {
    margin-bottom: 5px;
}

/* Results Styles */
.results-container {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 30px;
    margin-top: 20px;
}

.results-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    margin: 0;
    color: #333;
    text-align: center;
    width: 100%;
}

.recalculate-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e2e8f0;
}

.recalculate-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

.recalculate-button:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.key-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
}

.metric-card.highlight {
    background: #e8f4f8;
    border-color: #bee5eb;
}

.metric-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.metric-description {
    font-size: 12px;
    color: #888;
}

.deficit-info {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 30px;
}

.deficit-amount {
    margin-bottom: 15px;
}

.deficit-number {
    font-size: 48px;
    font-weight: 800;
    color: #0073aa;
}

.deficit-unit {
    font-size: 18px;
    color: #666;
    display: block;
    margin-top: 10px;
}

.timeline-info {
    font-size: 16px;
    color: #666;
}

.warning-message {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.warning-icon {
    font-size: 24px;
}

.warning-content strong {
    display: block;
    margin-bottom: 5px;
}

.diet-program-promotion {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 1px solid #10b981;
    border-radius: 10px;
    padding: 20px;
    margin: 0 0 30px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}

.promotion-icon {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.promotion-content p {
    margin: 0 0 15px 0;
    color: #065f46;
    font-weight: 500;
}

.promotion-content {
    text-align: center;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white !important;
    text-decoration: none !important;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cta-button:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
    text-decoration: none !important;
}

.results-details {
    margin-bottom: 30px;
}

.results-details h3,
.results-details h4 {
    color: #333;
}

.formula-explanation ul {
    padding-left: 20px;
}

.formula-explanation li {
    margin-bottom: 8px;
}

.progress-tracking {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 6px;
}

.tracking-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.tracking-button:hover {
    background: #218838;
}

/* Responsive Design - Results Section */
@media (max-width: 768px) {
    .results-container {
        padding: 15px;
        margin: 10px 0;
    }
    
    .results-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .results-header h2 {
        font-size: 1.4em;
        margin-bottom: 0;
        line-height: 1.3;
    }
    
    .key-metrics {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .metric-card {
        padding: 18px;
        border-radius: 12px;
    }
    
    .metric-label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .metric-value {
        font-size: 1.6em;
        margin-bottom: 4px;
    }
    
    .metric-description {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .deficit-number {
        font-size: 1.8em;
    }
    
    .cta-button {
        padding: 16px 32px;
        font-size: 16px;
        width: auto;
        margin: 0 auto;
        display: block;
    }
    
    .recalculate-button {
        padding: 12px 24px;
        font-size: 15px;
        width: 100%;
    }
    
    .diet-program-promotion {
        margin: 20px 0;
        padding: 16px;
    }
    
    .diet-program-promotion p {
        font-size: 15px;
        line-height: 1.4;
    }
}

/* Chart.js styles */
.progress-chart {
    margin-top: 30px;
}

.progress-chart canvas {
    max-width: 100%;
    height: auto;
}
