/* Calories Burned Calculator - Main Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.cbc-container {
    width: 100%;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cbc-wrapper {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Section */
.cbc-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.cbc-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.cbc-subtitle {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 300;
    letter-spacing: 0.3px;
}

/* Form Section */
.cbc-form {
    padding: 40px 30px;
}

.cbc-form-group {
    margin-bottom: 25px;
}

.cbc-form-group:last-of-type {
    margin-bottom: 30px;
}

.cbc-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input Styles */
.cbc-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    color: #333;
    background-color: #f9f9f9;
}

.cbc-input:focus {
    outline: none;
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cbc-input::placeholder {
    color: #999;
}

/* Select Styles */
.cbc-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background-color: #f9f9f9;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    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='currentColor' 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 10px center;
    background-size: 20px;
    padding-right: 40px;
}

.cbc-select:focus {
    outline: none;
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cbc-select option {
    color: #333;
    background-color: white;
    padding: 8px;
}

/* Input Group for Weight */
.cbc-input-group {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 10px;
    align-items: flex-start;
}

.cbc-input-group .cbc-select {
    margin-top: 0;
}

/* Radio Buttons */
.cbc-intensity-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.cbc-radio {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.cbc-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.cbc-radio-label {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.cbc-radio input[type="radio"]:checked + .cbc-radio-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cbc-radio:hover .cbc-radio-label {
    border-color: #667eea;
    background-color: #f0f3ff;
}

.cbc-radio input[type="radio"]:checked:hover + .cbc-radio-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-color: #667eea;
}

/* Button Group */
.cbc-button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Buttons */
.cbc-btn {
    padding: 13px 25px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 48px;
    font-family: inherit;
}

.cbc-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    grid-column: 1 / -1;
}

.cbc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.cbc-btn-primary:active {
    transform: translateY(0);
}

.cbc-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cbc-btn-secondary {
    background-color: #e8e8e8;
    color: #333;
    border: 2px solid #d0d0d0;
    grid-column: 2;
}

.cbc-btn-secondary:hover {
    background-color: #d8d8d8;
    border-color: #c0c0c0;
}

.cbc-btn-secondary:active {
    transform: translateY(0);
}

/* Result Section */
.cbc-result {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f3ff 100%);
    padding: 30px;
    border-top: 2px solid #667eea;
    animation: slideDown 0.5s ease-out;
}

.cbc-result.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cbc-result-header {
    text-align: center;
    margin-bottom: 25px;
}

.cbc-result-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cbc-result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.cbc-result-main {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.cbc-result-calories {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cbc-result-unit {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.cbc-result-details {
    width: 100%;
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.cbc-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cbc-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cbc-detail-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Error Messages */
.cbc-error {
    background-color: #fee;
    border-left: 4px solid #f44;
    color: #c00;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

.cbc-error.hidden {
    display: none;
}

/* Loading State */
.cbc-btn-primary.loading {
    opacity: 0.7;
    pointer-events: none;
}

.cbc-btn-primary.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .cbc-container {
        padding: 10px;
    }

    .cbc-wrapper {
        border-radius: 8px;
    }

    .cbc-header {
        padding: 30px 20px;
    }

    .cbc-title {
        font-size: 24px;
    }

    .cbc-subtitle {
        font-size: 13px;
    }

    .cbc-form {
        padding: 25px 20px;
    }

    .cbc-form-group {
        margin-bottom: 20px;
    }

    .cbc-input-group {
        grid-template-columns: 1fr 90px;
    }

    .cbc-intensity-group {
        grid-template-columns: 1fr;
    }

    .cbc-button-group {
        grid-template-columns: 1fr;
    }

    .cbc-btn-primary {
        grid-column: 1;
    }

    .cbc-btn-secondary {
        grid-column: 1;
    }

    .cbc-result-calories {
        font-size: 36px;
    }

    .cbc-result-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cbc-detail-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .cbc-detail-label {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .cbc-title {
        font-size: 20px;
    }

    .cbc-label {
        font-size: 13px;
    }

    .cbc-input,
    .cbc-select {
        font-size: 16px;
        padding: 10px 12px;
    }

    .cbc-btn {
        font-size: 13px;
        padding: 10px 15px;
        min-height: 44px;
    }

    .cbc-result-calories {
        font-size: 32px;
    }

    .cbc-result-unit {
        font-size: 14px;
    }
}

/* Accessibility */
.cbc-input:focus,
.cbc-select:focus,
.cbc-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
