/* Dashboard Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #b99566;
    --accent-color: #d8b87f;
    --dark-bg: #1a1a1a;
    --light-bg: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --gray-800: #343a40;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--dark-bg);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray-600);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-800);
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

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

.form-footer {
    text-align: center;
    margin-top: 16px;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--dark-bg);
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.role-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-item .icon {
    margin-right: 12px;
    font-size: 20px;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.section-header h1 {
    font-size: 32px;
    color: var(--dark-bg);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Billing card - block layout for better alignment */
.billing-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 150px;
}

.stat-icon {
    font-size: 48px;
    margin-right: 20px;
}

.stat-content h3 {
    font-size: 28px;
    color: var(--dark-bg);
    margin-bottom: 4px;
}

.stat-content p {
    color: var(--gray-600);
    font-size: 14px;
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--gray-200);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}

.data-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--gray-200);
}

.data-table tr:hover {
    background: var(--gray-100);
}

.text-center {
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-800);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: var(--gray-800);
    font-weight: 600;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-lg {
    max-width: 800px;
}

.modal-close {
    float: right;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray-600);
}

.modal-close:hover {
    color: var(--dark-bg);
}

.modal h2 {
    margin-bottom: 24px;
    color: var(--dark-bg);
}

/* Form */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-800);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

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

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 16px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 16px;
}

.info-message {
    background: #d1ecf1;
    color: #0c5460;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 16px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--dark-bg);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.5s ease;
}

/* Recent Activity */
.recent-activity {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recent-activity h2 {
    margin-bottom: 16px;
    font-size: 20px;
}

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

.activity-item {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    gap: 12px;
    padding: 12px;
    background: var(--gray-100);
    border-radius: 8px;
    font-size: 14px;
}

.activity-product {
    font-weight: 500;
}

.activity-customer {
    color: var(--gray-600);
}

.activity-time {
    text-align: right;
    color: var(--gray-600);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-header h2,
    .sidebar-nav span:not(.icon),
    .user-info,
    .role-badge {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 16px;
    }

    .main-content {
        padding: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .activity-item {
        grid-template-columns: 1fr;
    }
}

/* Period Selector */
.period-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.period-btn {
    padding: 8px 16px;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.3s ease;
}

.period-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.period-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Product link hover effect */
.product-link:hover {
    text-decoration: underline;
}

/* ============================================
   BILLING MODAL STYLES
   ============================================ */

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

/* Modal Content */
.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content.large {
    max-width: 1000px;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Billing Tabs Navigation */
.billing-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 20px;
    background: #fafafa;
    overflow-x: auto;
}

.tab-btn {
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    background: white;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* Plan Selector */
.plan-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.plan-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.plan-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
}

.plan-card h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: var(--text-dark);
}

.plan-price {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
}

.plan-tryon {
    color: #666;
    margin: 10px 0 20px 0;
    font-size: 14px;
}

.select-plan-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
}

/* Plan Badges */
.plan-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.current-badge {
    background: #e0e0e0;
    color: #666;
}

.upgrade-badge {
    background: #d4edda;
    color: #155724;
}

.downgrade-badge {
    background: #fff3cd;
    color: #856404;
}

/* Plan Card States */
.plan-card.current-plan {
    border-color: #999;
    background: #f5f5f5;
    opacity: 0.7;
    cursor: default;
}

.plan-card.current-plan:hover {
    transform: none;
    box-shadow: none;
    border-color: #999;
}

.plan-card.upgrade-plan {
    border-color: #28a745;
}

.plan-card.upgrade-plan:hover {
    border-color: #28a745;
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.2);
}

.plan-card.downgrade-plan {
    border-color: #ffc107;
}

.plan-card.downgrade-plan:hover {
    border-color: #ffc107;
    box-shadow: 0 10px 25px rgba(255, 193, 7, 0.2);
}

.select-plan-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.select-plan-btn.disabled:hover {
    background: #ccc;
    transform: none;
}

/* Embedded Checkout Container */
#embeddedCheckout {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Invoice List */
#invoicesList {
    min-height: 200px;
}

.invoice-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

.invoice-row:hover {
    background: #f5f5f5;
}

.invoice-info {
    flex: 1;
}

.invoice-number {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.invoice-date {
    font-size: 13px;
    color: #666;
}

.invoice-amount {
    font-size: 18px;
    font-weight: bold;
    color: var(--success);
    margin-right: 20px;
}

.invoice-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 15px;
}

.invoice-status.paid {
    background: #d4edda;
    color: #155724;
}

.invoice-status.pending {
    background: #fff3cd;
    color: #856404;
}

.download-invoice-btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* Payment Method Display */
.payment-card-display {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin: 20px 0;
    background: #fafafa;
}

.card-icon {
    font-size: 40px;
    margin-right: 20px;
}

.card-details {
    flex: 1;
}

.card-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.card-expiry {
    font-size: 14px;
    color: #666;
}

.update-payment-btn {
    margin-left: auto;
}

/* Stripe Payment Element */
#paymentElement {
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 20px 0;
    background: white;
}

#submitPaymentMethod {
    margin-top: 20px;
    margin-right: 10px;
}

/* Subscription Details */
.subscription-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
}

.subscription-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.subscription-status.active {
    background: #d4edda;
    color: #155724;
}

.subscription-status.canceled {
    background: #f8d7da;
    color: #721c24;
}

.subscription-info {
    margin: 20px 0;
}

.subscription-info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.subscription-info-row:last-child {
    border-bottom: none;
}

.subscription-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

/* Billing Info Form */
#billingInfoForm {
    max-width: 600px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

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

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 16px;
    color: #666;
}

/* Loading State */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .billing-tabs {
        padding: 0 10px;
    }

    .tab-btn {
        padding: 12px 15px;
        font-size: 13px;
    }

    .tab-content {
        padding: 20px;
    }

    .plan-selector {
        grid-template-columns: 1fr;
    }

    .invoice-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .invoice-amount {
        margin-right: 0;
    }

    .payment-card-display {
        flex-direction: column;
        text-align: center;
    }

    .card-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .update-payment-btn {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PRODUCT IMAGES SECTION
   ============================================ */

/* Upload Form Card */
.upload-form-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-form-card h3 {
    margin-bottom: 10px;
    color: #333;
}

/* Image Source Tabs */
.image-source-tabs {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.source-tab {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.source-tab:hover {
    border-color: var(--primary-color);
}

.source-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: #f5f0e8;
}

.file-upload-content p {
    margin: 10px 0 5px;
    color: #666;
}

.file-upload-content small {
    color: #999;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.file-preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.file-preview span {
    flex: 1;
    font-size: 14px;
    color: #333;
    word-break: break-all;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #e0e0e0;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Search Filter Bar */
.search-filter-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

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

.count-badge {
    background: #f0f0f0;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Product Images Grid */
.product-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-image-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.product-image-preview {
    width: 100%;
    aspect-ratio: 3/4;
    background: #f5f5f5;
    overflow: hidden;
}

.product-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-image-card:hover .product-image-preview img {
    transform: scale(1.05);
}

.product-image-info {
    padding: 15px;
}

.product-image-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-image-id {
    font-family: monospace;
    font-size: 12px;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    color: #666;
    display: inline-block;
    margin-bottom: 6px;
}

.product-image-handle {
    font-size: 12px;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.product-image-date {
    font-size: 12px;
    color: #999;
}

.product-image-actions {
    padding: 0 15px 15px;
    display: flex;
    gap: 10px;
}

.product-image-actions .btn {
    flex: 1;
    font-size: 12px;
    padding: 8px 12px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    background: #333;
    color: white;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 10000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.info {
    background: var(--primary-color);
}

/* Responsive Product Images */
@media (max-width: 768px) {
    .product-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .upload-form-card {
        padding: 20px;
    }

    .image-source-tabs {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .product-image-actions {
        flex-direction: column;
    }
}

/* ============================================
   TRY-ON TEST SECTION
   ============================================ */

.section-description {
    color: #666;
    margin-bottom: 30px;
    font-size: 15px;
    line-height: 1.6;
}

/* Test Config Grid */
.test-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.test-config-panel {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.test-config-panel h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Form Select */
.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

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

/* Manual Entry Divider */
.manual-entry-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #999;
    font-size: 13px;
}

.manual-entry-divider::before,
.manual-entry-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.manual-entry-divider span {
    padding: 0 15px;
}

/* Input with Button */
.input-with-button {
    display: flex;
    gap: 10px;
}

.input-with-button input {
    flex: 1;
}

.input-with-button .btn {
    flex-shrink: 0;
    padding: 10px 14px;
}

/* Test Actions */
.test-actions {
    text-align: center;
    margin-bottom: 30px;
}

.btn-lg {
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
}

/* Test Iframe Container */
.test-iframe-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: 30px;
}

.iframe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.iframe-header span {
    font-weight: 600;
    color: #333;
}

.test-iframe {
    width: 100%;
    height: 700px;
    border: none;
    display: block;
}

/* Debug Panel */
.debug-panel {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.debug-toggle {
    width: 100%;
    padding: 12px 20px;
    background: #f0f0f0;
    border: none;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.debug-toggle:hover {
    background: #e8e8e8;
}

.debug-toggle span {
    font-size: 10px;
    transition: transform 0.2s;
}

.debug-content {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.debug-item {
    margin-bottom: 15px;
}

.debug-item:last-child {
    margin-bottom: 0;
}

.debug-item strong {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.debug-item code {
    display: block;
    background: #f5f5f5;
    padding: 10px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    color: #333;
    word-break: break-all;
    overflow-x: auto;
}

.debug-item pre {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    color: #333;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Responsive Try-On Test */
@media (max-width: 992px) {
    .test-config-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .test-config-panel {
        padding: 20px;
    }

    .test-iframe {
        height: 600px;
    }

    .input-with-button {
        flex-direction: column;
    }

    .input-with-button .btn {
        width: 100%;
    }
}

/* ==========================================
   Settings Section Styles
   ========================================== */

.settings-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.settings-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.settings-description {
    color: #666;
    margin-bottom: 8px;
    font-size: 14px;
}

.settings-hint {
    color: #888;
    font-style: italic;
    font-size: 13px;
    margin-bottom: 25px;
    padding: 12px 15px;
    background: #f8f8f8;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.loading-messages-container {
    max-width: 600px;
}

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

.loading-messages-container label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.loading-messages-container input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.loading-messages-container input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.loading-messages-container input[type="text"]::placeholder {
    color: #aaa;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
    padding: 10px 0;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}

.settings-card .form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
}

/* Settings Row - Two columns */
.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

/* Color Input Wrapper */
.color-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 50px;
    height: 40px;
    padding: 2px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    background: white;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-input-wrapper input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: monospace;
    font-size: 14px;
    text-transform: uppercase;
}

.color-input-wrapper input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Form Hint */
.form-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

/* Checkbox Group */
.checkbox-group {
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Preview Section */
.preview-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.preview-section h4 {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Button Preview */
.button-preview {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    justify-content: center;
}

.preview-btn {
    padding: 14px 32px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: default;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.preview-btn.primary {
    background: linear-gradient(135deg, #b99566 0%, #d8b87f 100%);
    color: white;
    border-radius: 50px;
}

.preview-btn.secondary {
    background: transparent;
    color: #b99566;
    border: 2px solid #b99566;
    border-radius: 50px;
}

/* Responsive Settings */
@media (max-width: 768px) {
    .settings-card {
        padding: 20px;
    }

    .settings-card .form-actions {
        flex-direction: column;
    }

    .settings-card .form-actions .btn {
        width: 100%;
    }

    .settings-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .button-preview {
        flex-direction: column;
        padding: 20px;
    }

    .preview-btn {
        width: 100%;
    }
}
