/**
 * FoodFinder Widget 1 - Styles
 * Rozpoznawanie zdjęć jedzenia
 */

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

.foodfinder-widget {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 600px;
    margin: 40px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.foodfinder-header {
    background: linear-gradient(135deg, #F85326 0%, #FF7A50 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.foodfinder-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: white;
}

.foodfinder-header p {
    opacity: 0.9;
    font-size: 14px;
    color: white;
}

.foodfinder-body {
    padding: 30px;
}

.ff-upload-area {
    border: 3px dashed #F85326;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff8f6;
}

.ff-upload-area:hover {
    border-color: #FF7A50;
    background: #fff0eb;
}

.ff-upload-area.drag-over {
    border-color: #FF7A50;
    background: #ffe8e0;
    transform: scale(1.02);
}

.ff-upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.ff-upload-area h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 18px;
}

.ff-upload-area p {
    color: #666;
    font-size: 14px;
}

.ff-file-input {
    display: none;
}

.ff-upload-btn {
    background: linear-gradient(135deg, #F85326 0%, #FF7A50 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
    transition: transform 0.2s;
}

.ff-upload-btn:hover {
    transform: translateY(-2px);
    color: white;
}

.ff-preview-area {
    display: none;
    margin-top: 20px;
}

.ff-preview-area.active {
    display: block;
}

.ff-image-preview {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background: #f5f5f5;
}

.ff-preview-area.with-results {
    margin-bottom: 30px;
}

.ff-preview-area.with-results .ff-analyze-btn {
    display: none;
}

/* === STYLE DLA POLA DODATKOWYCH INFORMACJI === */
.ff-additional-info-section {
    margin-top: 20px;
}

.ff-additional-info-section label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.ff-additional-info-section textarea {
    width: 100%;
    min-height: 70px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: white;
}

.ff-additional-info-section textarea:focus {
    outline: none;
    border-color: #F85326;
    box-shadow: 0 0 0 3px rgba(248, 83, 38, 0.1);
}

.ff-additional-info-section textarea::placeholder {
    color: #999;
}

.ff-analyze-btn {
    background: linear-gradient(135deg, #F85326 0%, #FF7A50 100%);
    color: white !important;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(248, 83, 38, 0.3);
}

.ff-analyze-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(248, 83, 38, 0.4);
    color: white !important;
}

.ff-analyze-btn:active {
    transform: scale(1.01);
}

.ff-loading {
    display: none;
    text-align: center;
    padding: 30px;
}

.ff-loading.active {
    display: block;
}

.ff-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #F85326;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: ff-spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.ff-loading p {
    color: #666;
    font-size: 16px;
}

.ff-results {
    display: none;
    animation: ff-fadeIn 0.5s ease;
}

.ff-results.active {
    display: block;
}

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

.ff-dish-name {
    background: linear-gradient(135deg, #F85326 0%, #FF7A50 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.ff-dish-name h3 {
    font-size: 28px;
    margin-bottom: 5px;
    color: white;
}

.ff-dish-emoji {
    font-size: 40px;
    margin-bottom: 10px;
}

.ff-recipe-section {
    background: #f0ede6;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    border: 2px solid #f85326;
}

.ff-recipe-section h4 {
    color: #1a8a8a;
    margin-bottom: 15px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ff-macro-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.ff-macro-item {
    background: white;
    padding: 15px 10px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ff-macro-value {
    font-size: 18px;
    font-weight: bold;
    color: #F85326;
}

.ff-macro-label {
    font-size: 12px;
    color: #666;
}

.ff-recipe-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.ff-info-item {
    background: white;
    padding: 12px 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #666;
}

.ff-ingredients-list {
    list-style: none;
    margin-bottom: 0;
}

.ff-ingredients-list li {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.ff-ingredients-list li:last-child {
    border-bottom: none;
}

.ff-instructions-list {
    list-style: none;
    counter-reset: step-counter;
}

.ff-instructions-list li {
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 10px;
    counter-increment: step-counter;
    position: relative;
    padding-left: 50px;
    color: #333;
}

.ff-instructions-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 15px;
    top: 15px;
    background: linear-gradient(135deg, #F85326 0%, #FF7A50 100%);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

/* === STYLE DLA ROZWIJANEGO SZCZEGÓŁU KROKU === */
.ff-step-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.ff-step-text {
    flex: 1;
}

.ff-step-expand-btn {
    background: none;
    border: 2px solid #F85326;
    color: #F85326;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
}

.ff-step-expand-btn:hover {
    background: #F85326;
    color: white;
    transform: scale(1.1);
}

.ff-step-expand-btn.expanded {
    background: #F85326;
    color: white;
    transform: rotate(45deg);
}

.ff-step-details {
    display: none;
    margin-top: 12px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fff8f6 0%, #fff0eb 100%);
    border-left: 3px solid #F85326;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    animation: ff-slideDown 0.3s ease;
}

.ff-step-details.active {
    display: block;
}

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

.ff-step-details-icon {
    margin-right: 6px;
    color: #F85326;
}

/* === SEKCJA WSKAZÓWEK === */
.ff-tips-section {
    background: #e8f5e9;
    border: 2px solid #4caf50;
}

.ff-tips-section h4 {
    color: #2e7d32;
}

.ff-tips-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ff-tips-list li {
    padding: 10px 10px 10px 35px;
    border-bottom: 1px solid #c8e6c9;
    color: #333;
    position: relative;
}

.ff-tips-list li:last-child {
    border-bottom: none;
}

.ff-tips-list li::before {
    content: '\1F4A1';
    position: absolute;
    left: 8px;
    top: 10px;
}

.ff-reset-btn {
    background: #F85326;
    color: white;
    border: 2px solid #F85326;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.ff-reset-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px #F85326;
    background: #F85326;
    color: white;
}

.ff-error-message {
    display: none;
    background: #ffe0e0;
    color: #d32f2f;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    text-align: center;
}

.ff-error-message.active {
    display: block;
}

/* Klasa wymuszająca ukrycie elementu */
.ff-hidden {
    display: none !important;
    visibility: hidden !important;
}

@media (max-width: 600px) {
    .foodfinder-header h2 {
        font-size: 24px;
    }

    .ff-dish-name h3 {
        font-size: 24px;
    }

    .ff-upload-area {
        padding: 30px 15px;
    }

    .ff-macro-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
