/* HabitWins Rewards CSS */

/* NEW REWARDS SECTION STYLES (Compatible with create_contract) */
.reward-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.reward-section-header {
    margin-bottom: 8px;
}

.reward-label {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    margin-bottom: 10px;
}

.reward-choice {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toggle Switch Style */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    border-radius: 25px;
    padding: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-option {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.toggle-option.active {
    color: white;
    background: var(--primary-gradient);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.toggle-option:hover:not(.active) {
    color: #667eea;
}

.reward-input-section {
    margin-bottom: 20px;
}

.reward-input-section .reward-dropdown-container {
    position: relative;
}

.reward-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    background: white;
}

.reward-input:focus {
    outline: none;
    border-color: #667eea;
}

.reward-input:focus + .reward-suggestions-dropdown {
    display: block;
}

/* Expanded reward sections */
.reward-expanded {
    margin-left: 0;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 2px dashed #ddd;
}

.expanded-info {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.expanded-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reward-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.week-number {
    font-weight: 600;
    color: #667eea;
    min-width: 80px;
    font-size: 0.9rem;
}

.reward-dropdown-container {
    position: relative;
    flex: 1;
}

.reward-input-mini {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: border-color 0.3s ease;
    background: white;
}

.reward-input-mini:focus {
    outline: none;
    border-color: #667eea;
}

.reward-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-height: 150px;
    overflow-y: auto;
}

.reward-suggestions-dropdown:hover {
    display: block;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* ========================================= */
/* REWARD SUGGESTIONS - THEME-AWARE         */
/* ========================================= */

/* RAINBOW THEME - Suggestions */
[data-theme="rainbow"] .reward-suggestions-dropdown {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    border: 2px solid rgba(255, 107, 157, 0.3);
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.2);
}

[data-theme="rainbow"] .suggestion-item {
    color: #333;
    border-bottom-color: rgba(255, 107, 157, 0.1);
}

[data-theme="rainbow"] .suggestion-item:hover {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.15), rgba(173, 216, 230, 0.15));
    color: #FF6B9D;
}

/* NEON THEME - Suggestions (DARK) */
[data-theme="neon"] .reward-suggestions-dropdown {
    background: rgba(26, 26, 26, 0.98);
    border: 1px solid rgba(0, 255, 136, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 255, 136, 0.2);
}

[data-theme="neon"] .suggestion-item {
    color: #CCCCCC;
    border-bottom-color: rgba(0, 255, 136, 0.1);
}

[data-theme="neon"] .suggestion-item:hover {
    background: rgba(0, 255, 136, 0.1);
    color: #00FF88;
    box-shadow: inset 0 0 10px rgba(0, 255, 136, 0.1);
}

/* MINIMAL THEME - Suggestions */
[data-theme="minimal"] .reward-suggestions-dropdown {
    background: rgba(248, 250, 252, 1);
    border: 1px solid rgba(226, 232, 240, 1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

[data-theme="minimal"] .suggestion-item {
    color: #1E293B;
    border-bottom-color: rgba(226, 232, 240, 0.6);
}

[data-theme="minimal"] .suggestion-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #2563EB;
}

.btn-add-week, .btn-add-month {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
    margin-top: 8px;
}

.btn-add-week:hover, .btn-add-month:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Current Rewards Display */
.current-rewards {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.current-rewards h5 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1rem;
}

.edit-rewards h5 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1rem;
}

.reward-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.reward-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.reward-content {
    flex: 1;
}

.reward-title {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.reward-description {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.3;
    font-style: italic;
}

.reward-description:empty::before {
    content: "Brak ustawionej nagrody";
    color: #999;
}

/* New Rewards Management Styles */
.rewards-management {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.rewards-management h5 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1rem;
}

.reward-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reward-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: all 0.2s ease;
}

.reward-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.reward-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
}

.reward-info {
    flex: 1;
}

.reward-actions {
    display: flex;
    gap: 8px;
}

.reward-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reward-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.reward-btn.btn-edit:hover {
    background: #e3f2fd;
    border-color: #2196F3;
    color: #1976D2;
}

.reward-btn.btn-delete:hover {
    background: #ffebee;
    border-color: #f44336;
    color: #d32f2f;
}

.reward-btn.btn-save-small {
    background: #4CAF50;
    color: white;
    border-color: #45a049;
}

.reward-btn.btn-save-small:hover {
    background: #45a049;
}

.reward-btn.btn-cancel-small {
    background: #6c757d;
    color: white;
    border-color: #5a6268;
}

.reward-btn.btn-cancel-small:hover {
    background: #5a6268;
}

.reward-edit-form {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding: 0 15px;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding: 15px;
    }
}

.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end;
}

.reward-status {
    background: #fef5e7;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border: 2px solid #f39c12;
}

.reward-status h4 {
    color: #e67e22;
    margin-bottom: 10px;
}

/* Mobile responsiveness for rewards */
@media (max-width: 768px) {
    .reward-section {
        padding: 10px;
        margin-bottom: 15px;
        border-radius: 10px;
    }

    .reward-label {
        font-size: 0.85rem;
        margin-bottom: 6px;
        font-weight: 600;
        display: inline-block;
    }

    .toggle-option {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .reward-input {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .reward-input-mini {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    /* Mobile: Dropdown opens UPWARDS to avoid being hidden by keyboard */
    .reward-suggestions-dropdown {
        top: auto !important;
        bottom: 100% !important;
        margin-bottom: 2px;
    }

    .week-number {
        min-width: 60px;
        font-size: 0.8rem;
    }

    .reward-input-row {
        gap: 8px;
    }
}