/* static/css/advanced-share.css */
/* Styles for Advanced Sharing Feature */

/* ============================================
   Advanced Share FAB Button
   ============================================ */

.advanced-share-fab-button {
    position: fixed;
    bottom: 90px; /* Above the upload FAB */
    left: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.advanced-share-fab-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

[dir="rtl"] .advanced-share-fab-button {
    left: auto;
    right: 20px;
}

/* ============================================
   Share Type Selection Modal
   ============================================ */

.share-type-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.share-type-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.share-type-option:hover {
    border-color: #007bff;
    background: #f8f9ff;
    transform: translateX(-5px);
}

.share-type-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.share-type-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.share-type-desc {
    font-size: 0.9rem;
    color: #666;
    margin-top: 4px;
}

/* ============================================
   Selection Mode
   ============================================ */

.selection-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.selection-count {
    font-size: 1.1rem;
}

.selection-count strong {
    font-size: 1.3rem;
}

.selection-bar .button {
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
}

.selection-bar .secondary-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.selection-bar .secondary-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.selection-bar .primary-button {
    background: white;
    color: #667eea;
}

.selection-bar .primary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Gallery Selection Mode */
#gallery.selection-mode .image-container {
    cursor: pointer;
    position: relative;
}

#gallery.selection-mode .image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s;
    pointer-events: none;
}

#gallery.selection-mode .image-container:hover::after {
    background: rgba(102, 126, 234, 0.1);
}

#gallery.selection-mode .image-container.selected::after {
    background: rgba(102, 126, 234, 0.3);
    border: 3px solid #667eea;
}

.selection-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
}

#gallery.selection-mode .selection-checkbox {
    opacity: 1;
}

.selection-checkbox i {
    color: white;
    font-size: 14px;
    opacity: 0;
}

.image-container.selected .selection-checkbox {
    background: #667eea;
    border-color: #667eea;
}

.image-container.selected .selection-checkbox i {
    opacity: 1;
}

/* ============================================
   Finish Share Modal
   ============================================ */

.selected-items-preview {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.preview-item {
    text-align: center;
}

.preview-item img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.preview-item span {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.outfit-categories {
    background: #fff9e6;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #f0e0a0;
}

#categorySelectors {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.category-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex: 1;
}

.category-selector img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}

@media (max-width: 480px) {
    #categorySelectors {
        flex-direction: column;
    }
    .category-selector {
        flex-direction: row;
    }
    .category-selector img {
        width: 50px;
        height: 60px;
    }
}

.category-selector select {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.category-auto-label {
    flex: 1;
    padding: 10px;
    font-weight: 600;
    color: #333;
    background: #f0f0f0;
    border-radius: 6px;
    text-align: center;
}

/* Share Result Area */
.share-link-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.share-link-box input {
    flex: 1;
    padding: 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: #f8f9ff;
    font-size: 0.9rem;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.whatsapp-btn {
    background: #25D366 !important;
    color: white !important;
}

.whatsapp-btn:hover {
    background: #1da851 !important;
}

/* ============================================
   Management Page
   ============================================ */

.shares-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.shares-table th,
.shares-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.shares-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.shares-table tr:hover {
    background: #f8f9ff;
}

.share-type-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.share-type-badge.comparison {
    background: #e3f2fd;
    color: #1976d2;
}

.share-type-badge.collection {
    background: #f3e5f5;
    color: #7b1fa2;
}

.share-type-badge.outfit {
    background: #fff3e0;
    color: #f57c00;
}

.stat-number {
    font-weight: 600;
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-btn.copy {
    background: #e3f2fd;
    color: #1976d2;
}

.action-btn.edit {
    background: #fff3e0;
    color: #f57c00;
}

.action-btn.delete {
    background: #ffebee;
    color: #c62828;
}

.action-btn.resend {
    background: #e8f5e9;
    color: #2e7d32;
}

.action-btn:hover {
    transform: scale(1.1);
}

/* ============================================
   Customer Share Page
   ============================================ */

.advanced-share-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.share-header {
    text-align: center;
    margin-bottom: 30px;
}

.share-header h1 {
    color: #333;
    margin-bottom: 10px;
}

.share-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.share-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.share-item-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.share-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.share-item-card img {
    width: 100%;
    height: 280px;
    object-fit: contain;
    background: #f5f5f5;
    padding: 10px;
    box-sizing: border-box;
}

.share-item-card .item-name {
    padding: 15px;
    text-align: center;
    font-weight: 500;
}

.share-item-card.selected {
    border: 3px solid #667eea;
}

.tryon-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.upload-model-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-model-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.tryon-result {
    margin-top: 20px;
}

.tryon-result img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .selection-bar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 15px;
    }

    .selection-count {
        width: 100%;
        text-align: center;
    }

    .share-type-option {
        padding: 15px;
    }

    .share-type-icon {
        font-size: 1.5rem;
        width: 40px;
    }

    .shares-table {
        font-size: 0.9rem;
    }

    .shares-table th,
    .shares-table td {
        padding: 10px;
    }

    .action-buttons {
        flex-wrap: wrap;
    }

    .share-items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .share-items-grid {
        grid-template-columns: 1fr;
    }

    .share-item-card img {
        height: 320px;
    }
}
