/* Order Tracker Styles - Enhanced with Dynamic Sections */
@import url('../../shared/styles/shared.css');

/* Address Display - Multi-line support */
#addressDisplay {
    white-space: pre-line;
    display: block;
    margin-top: 5px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-family: inherit;
    line-height: 1.5;
}

/* Container */
.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Header Section */
.header-section {
    position: relative;
    text-align: center;
    margin-bottom: 30px;
}

.header-section h1 {
    margin: 0;
}

/* Track Another Order Button */
.track-another-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.track-another-btn:hover {
    background: #1f4b57;
    transform: translateY(-50%) scale(1.05);
}

/* Credits Button */
.credits-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.credits-btn:hover {
    background: #1e7e34;
    transform: translateY(-50%) scale(1.05);
}

/* Form Section */
.form-section {
    text-align: center;
    transition: all 0.5s ease;
    max-height: 500px;
    overflow: hidden;
    opacity: 1;
}

.form-section.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

/* Form Styling */
#orderForm {
    display: inline-block;
    text-align: left;
    max-width: 400px;
    width: 100%;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

#orderForm button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#orderForm button[type="submit"]:hover {
    background: #1f4b57;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 110, 127, 0.3);
}

/* Error Messages */
.error {
    color: var(--danger-color);
    margin-top: 10px;
    font-size: 0.9rem;
    padding: 8px;
    background: #fee;
    border-radius: 4px;
}

/* Order Details */
.order-details {
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
    text-align: center;
}

.order-details h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
}

.order-details p {
    margin: 10px 0;
    font-size: 1rem;
    text-align: center;
}

.order-details strong {
    color: #333;
}

/* Products List */
#productsList {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.product-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-container {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    flex-direction: row;
}

.product-preview {
    width: 100px;
    height: 100px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    background: white;
    border: 1px solid #ddd;
}

.product-preview:hover::after {
    content: 'View Details';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 10;
}

.product-text-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-text {
    font-size: 16px;
    color: #333;
    text-align: left;
    margin: 0;
}

/* Product Messages */
.product-messages {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
}

.pending-checkout-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 8px 12px;
    color: #856404;
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
    font-weight: 500;
}

.refund-pending-message {
    background: #f8d7da;
    border: 1px solid var(--danger-color);
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--danger-color);
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
}

/* Dynamic Status Section */
.dynamic-status-section {
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    color: white;
    text-align: center;
    animation: slideInFromTop 0.5s ease;
    position: relative;
    overflow: hidden;
}

.dynamic-status-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

.status-content {
    position: relative;
    z-index: 1;
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

.status-title {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.status-subtitle {
    font-size: 1.2rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.status-description {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 20px 0;
    opacity: 0.95;
    text-align: center !important;
}

/* Queue Progress Bar */
.queue-progress-container {
    margin: 20px 0;
    padding: 0 20px;
}

.queue-progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.queue-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 50%, #ffc107 100%);
    transition: width 1s ease, background 0.5s ease;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.queue-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

.queue-progress-fill.green {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.queue-progress-fill.yellow {
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
}

.queue-progress-fill.red {
    background: linear-gradient(90deg, #ff6b6b 0%, #ee5a6f 100%);
}

/* Collapsible Learn More Section */
.learn-more-section {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.learn-more-toggle {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.learn-more-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.learn-more-toggle .arrow {
    transition: transform 0.3s ease;
}

.learn-more-toggle.active .arrow {
    transform: rotate(180deg);
}

.learn-more-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease;
    padding: 0 20px;
}

.learn-more-content.active {
    max-height: 500px;
    padding: 20px;
}

.learn-more-content p {
    margin: 10px 0;
    line-height: 1.6;
    opacity: 0.95;
}

/* Tracking Section */
.tracking-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.tracking-number {
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.track-btn {
    margin-top: 15px;
    padding: 12px 24px;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.track-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Care Guide Download */
.care-guide-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.download-care-guide {
    padding: 12px 24px;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.download-care-guide:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Timeline Progress Bar */
.timeline-section {
    margin: 40px 0;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-top: 20px;
}

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

.stage {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.stage-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.stage.completed .stage-icon,
.stage.active .stage-icon {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(44, 110, 127, 0.4);
}

.stage.completed .stage-icon {
    background: var(--success-color);
}

.stage-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
}

.stage.completed .stage-label,
.stage.active .stage-label {
    color: var(--primary-color);
}

.stage-timestamp {
    font-size: 0.75rem;
    color: #999;
    margin-top: 5px;
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#updateOrderBtn {
    background: var(--success-color);
    color: white;
}

#updateOrderBtn:hover {
    background: #218838;
}

#orderChangeAddressBtn {
    background: var(--warning-color);
    color: white;
}

#orderChangeAddressBtn:hover {
    background: #e0a800;
}

#cancelOrderBtn {
    background: #c1121f;
    color: white;
}

#cancelOrderBtn:hover {
    background: #c1121f;
}

#trackingBtn {
    background: var(--info-color);
    color: white;
}

#trackingBtn:hover {
    background: #1976D2;
}

/* Loading Skeleton */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    height: 20px;
    margin: 10px 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .track-another-btn {
        position: static;
        transform: none;
        margin-bottom: 15px;
        display: block;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .track-another-btn:hover {
        transform: scale(1.05);
    }

    .credits-btn {
        position: static;
        transform: none;
        margin-bottom: 15px;
        display: block;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .credits-btn:hover {
        transform: scale(1.05);
    }

    .header-section {
        margin-bottom: 20px;
    }
    
    .product-container {
        flex-direction: column;
        text-align: center;
    }
    
    .product-preview {
        margin: 0 auto;
    }
    
    .dynamic-status-section {
        padding: 20px;
    }
    
    .status-title {
        font-size: 1.5rem;
    }
    
    .status-subtitle {
        font-size: 1rem;
    }
    
    .progress-bar {
        flex-direction: column;
        gap: 30px;
    }
    
    .progress-bar::before {
        display: none;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .status-icon {
        font-size: 2rem;
    }
    
    .status-title {
        font-size: 1.2rem;
    }
    
    .queue-progress-bar {
        height: 20px;
    }
    
    .track-another-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .credits-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}