/**
 * SweetPicks Public Styles
 */

/* Chat Widget */
.sp-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.sp-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sp-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.sp-chat-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.sp-chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.sp-chat-container.active {
    display: flex;
}

.sp-chat-header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sp-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.sp-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.sp-chat-message {
    margin-bottom: 16px;
    max-width: 85%;
}

.sp-chat-message.user {
    margin-left: auto;
    text-align: right;
}

.sp-chat-message.ai {
    margin-right: auto;
}

.sp-chat-bubble {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.sp-chat-message.user .sp-chat-bubble {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    border-bottom-right-radius: 4px;
}

.sp-chat-message.ai .sp-chat-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sp-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.sp-chat-suggestion {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sp-chat-suggestion:hover {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.sp-chat-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.sp-chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
}

.sp-chat-input:focus {
    border-color: #ff6b6b;
}

.sp-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.sp-chat-send:hover {
    transform: scale(1.05);
}

.sp-chat-send svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Pick & Mix Interface */
.sp-pick-mix-container {
    margin: 30px 0;
}

.sp-box-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.sp-box-option {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sp-box-option:hover {
    border-color: #ff6b6b;
}

.sp-box-option.selected {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.05);
}

.sp-box-option h4 {
    margin: 0 0 8px;
    font-size: 16px;
}

.sp-box-option .sp-box-weight {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.sp-box-option .sp-box-price {
    font-size: 20px;
    font-weight: 600;
    color: #ff6b6b;
}

.sp-sweets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sp-sweet-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sp-sweet-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.sp-sweet-image {
    aspect-ratio: 1;
    overflow: hidden;
}

.sp-sweet-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-sweet-info {
    padding: 12px;
}

.sp-sweet-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-sweet-price {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.sp-sweet-add {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.sp-sweet-add:hover {
    opacity: 0.9;
}

.sp-box-summary {
    position: sticky;
    bottom: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.sp-box-progress {
    flex: 1;
}

.sp-box-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sp-box-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.sp-box-progress-text {
    font-size: 13px;
    color: #666;
}

.sp-box-total {
    text-align: right;
}

.sp-box-total-label {
    font-size: 12px;
    color: #666;
}

.sp-box-total-amount {
    font-size: 24px;
    font-weight: 600;
    color: #ff6b6b;
}

.sp-box-checkout {
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.sp-box-checkout:hover {
    opacity: 0.9;
}

.sp-box-checkout:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Customer Dashboard */
.sp-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.sp-dashboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.sp-dashboard-header h2 {
    font-size: 32px;
    margin-bottom: 8px;
}

.sp-dashboard-header p {
    color: #666;
}

.sp-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.sp-dashboard-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.sp-dashboard-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.sp-rewards-tier {
    text-align: center;
    padding: 20px;
}

.sp-tier-badge {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.sp-tier-badge.bronze {
    background: linear-gradient(135deg, #cd7f32, #b87333);
}

.sp-tier-badge.silver {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
}

.sp-tier-badge.gold {
    background: linear-gradient(135deg, #ffd700, #daa520);
}

.sp-tier-badge.platinum {
    background: linear-gradient(135deg, #e5e4e2, #b8b8b8);
}

.sp-points-display {
    font-size: 36px;
    font-weight: 700;
    color: #ff6b6b;
}

.sp-points-label {
    color: #666;
    margin-bottom: 16px;
}

.sp-tier-progress {
    margin-top: 20px;
}

.sp-progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.sp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.sp-progress-text {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    text-align: center;
}

.sp-order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.sp-order-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.sp-order-info span {
    font-size: 12px;
    color: #666;
}

.sp-order-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.sp-order-status.processing {
    background: #fff3cd;
    color: #856404;
}

.sp-order-status.shipped {
    background: #d1ecf1;
    color: #0c5460;
}

.sp-order-status.delivered {
    background: #d4edda;
    color: #155724;
}

.sp-tracking-card {
    text-align: center;
    padding: 20px;
}

.sp-tracking-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-tracking-icon svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.sp-tracking-number {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.sp-tracking-status {
    color: #666;
    margin-bottom: 16px;
}

.sp-tracking-button {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
}

/* Tracking Page */
.sp-tracking-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
}

.sp-tracking-form {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.sp-tracking-form h2 {
    text-align: center;
    margin-bottom: 24px;
}

.sp-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.sp-form-row input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
}

.sp-form-row input:focus {
    border-color: #ff6b6b;
}

.sp-form-row button {
    padding: 14px 32px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.sp-tracking-result {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sp-tracking-header {
    text-align: center;
    margin-bottom: 40px;
}

.sp-tracking-header h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.sp-tracking-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.sp-tracking-progress::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 10%;
    right: 10%;
    height: 4px;
    background: #e0e0e0;
    z-index: 0;
}

.sp-tracking-step {
    text-align: center;
    position: relative;
    z-index: 1;
}

.sp-step-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 14px;
}

.sp-tracking-step.completed .sp-step-icon,
.sp-tracking-step.active .sp-step-icon {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
}

.sp-step-label {
    font-size: 12px;
    color: #666;
}

.sp-tracking-timeline {
    position: relative;
    padding-left: 30px;
}

.sp-timeline-item {
    position: relative;
    padding-bottom: 30px;
}

.sp-timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e0e0e0;
}

.sp-timeline-item::after {
    content: '';
    position: absolute;
    left: -17px;
    top: 20px;
    width: 2px;
    height: calc(100% - 12px);
    background: #e0e0e0;
}

.sp-timeline-item:last-child::after {
    display: none;
}

.sp-timeline-item.completed::before,
.sp-timeline-item.active::before {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.sp-timeline-item.active::before {
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2);
}

.sp-timeline-content h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.sp-timeline-content p {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.sp-timeline-date {
    font-size: 12px;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .sp-chat-container {
        width: calc(100vw - 40px);
        right: -10px;
    }
    
    .sp-sweets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sp-box-summary {
        flex-direction: column;
        gap: 16px;
    }
    
    .sp-form-row {
        flex-direction: column;
    }
    
    .sp-tracking-progress {
        display: none;
    }
}
