/**
 * My Virtual Try-Ons Dashboard
 * Clean, minimalist design matching MSMODA aesthetic
 */

.my-tryons-container {
    max-width: 1200px;
    margin: 80px auto 60px;
    padding: 0 20px;
    font-family: 'Open Sans', sans-serif;
}

/* Header */
.my-tryons-header {
    text-align: center;
    margin-bottom: 60px;
}

.my-tryons-header h1 {
    font-size: 36px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: #000000;
}

.my-tryons-header .subtitle {
    font-size: 16px;
    color: #666666;
    font-weight: 400;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    color: #cccccc;
    margin-bottom: 30px;
}

.empty-state h2 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 15px;
    color: #333333;
}

.empty-state p {
    font-size: 16px;
    color: #666666;
    margin-bottom: 30px;
}

/* Try-Ons Grid */
.tryons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.tryon-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    transition: transform 0.3s, box-shadow 0.3s;
}

.tryon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Dress Image */
.tryon-image {
    position: relative;
    width: 100%;
    padding-top: 133%; /* 3:4 aspect ratio */
    overflow: hidden;
    background: #f9f9f9;
}

.tryon-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tryon-image .no-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #cccccc;
    font-size: 14px;
}

/* Status Badge */
.status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e5e5;
}

.status-completed {
    color: #27ae60;
    border-color: #27ae60;
}

.status-processing {
    color: #f39c12;
    border-color: #f39c12;
}

.status-failed {
    color: #e74c3c;
    border-color: #e74c3c;
}

/* Dress Info */
.tryon-info {
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.dress-name {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 8px;
    color: #000000;
}

.dress-sku {
    font-size: 13px;
    color: #999999;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.tryon-date {
    font-size: 13px;
    color: #666666;
    margin-bottom: 8px;
}

.tryon-meta {
    font-size: 12px;
    color: #27ae60;
    margin-top: 8px;
}

/* Actions */
.tryon-actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-view {
    background: #000000;
    color: #ffffff;
}

.btn-view:hover {
    background: #333333;
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
    border: 1px solid #000000;
}

.btn-secondary:hover {
    background: #000000;
    color: #ffffff;
}

.btn-delete {
    background: #ffffff;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.btn-delete:hover {
    background: #e74c3c;
    color: #ffffff;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
}

.btn-primary:hover {
    background: #333333;
}

.result-expired,
.result-processing,
.result-failed {
    font-size: 13px;
    text-align: center;
    padding: 12px;
    color: #999999;
}

.result-failed {
    color: #e74c3c;
}

/* View buttons row */
.view-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.view-buttons .btn {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 11px;
}

.view-buttons .btn svg {
    flex-shrink: 0;
}

/* Delete button inline style */
.tryon-actions .btn-delete {
    padding: 10px;
    width: auto;
    align-self: flex-end;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tryon-actions .btn-delete svg {
    margin: 0;
}

/* Processing overlay and spinner */
.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #e5e5e5;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e5e5;
    border-top-color: #f39c12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result thumbnail styling */
.result-thumbnail {
    transition: transform 0.3s;
}

.tryon-card:hover .result-thumbnail {
    transform: scale(1.03);
}

.processing-placeholder {
    filter: grayscale(50%);
    opacity: 0.7;
}

/* Bulk Actions */
.bulk-actions {
    text-align: center;
    padding: 40px 20px;
    border-top: 2px solid #e5e5e5;
}

.btn-danger-outline {
    background: #ffffff;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    padding: 15px 40px;
    font-size: 14px;
}

.btn-danger-outline:hover {
    background: #e74c3c;
    color: #ffffff;
}

.gdpr-note {
    margin-top: 15px;
    font-size: 13px;
    color: #999999;
}

/* Result Modal */
.result-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s;
}

.result-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    background: #ffffff;
    padding: 20px;
}

.result-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.result-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

#result-image {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    display: block;
}

.result-actions {
    margin-top: 20px;
    text-align: center;
}

/* Delete Modal */
.delete-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.delete-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-modal-content {
    background: #ffffff;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.delete-modal-content h3 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 20px;
    color: #000000;
}

.delete-modal-content p {
    font-size: 16px;
    color: #666666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.delete-modal-content .warning {
    color: #e74c3c;
    font-weight: 600;
}

.delete-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.delete-actions .btn {
    flex: 1;
}

.btn-danger {
    background: #e74c3c;
    color: #ffffff;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Access & Error Pages */
.access-page,
.error-page {
    text-align: center;
    padding: 60px 20px;
    max-width: 700px;
    margin: 0 auto;
}

.access-page svg,
.error-page svg {
    color: #cccccc;
    margin-bottom: 30px;
}

.access-page h1,
.error-page h1 {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: #000000;
}

.error-message {
    background: #fee;
    border: 1px solid #e74c3c;
    padding: 15px;
    margin-bottom: 30px;
    color: #c0392b;
}

.access-info,
.error-info {
    font-size: 16px;
    color: #666666;
    margin-bottom: 40px;
    line-height: 1.8;
}

.access-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
    text-align: left;
}

.access-option {
    padding: 30px;
    border: 1px solid #e5e5e5;
    background: #fafafa;
}

.access-option h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #000000;
}

.access-option p {
    font-size: 14px;
    color: #666666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.privacy-note {
    margin-top: 60px;
    padding: 30px;
    background: #f9f9f9;
    border-left: 3px solid #000000;
    text-align: left;
}

.privacy-note p {
    font-size: 14px;
    color: #666666;
    line-height: 1.8;
}

.error-reasons {
    text-align: left;
    margin: 40px auto;
    max-width: 500px;
}

.error-reasons h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #000000;
}

.error-reasons ul {
    list-style: disc;
    padding-left: 25px;
}

.error-reasons li {
    font-size: 14px;
    color: #666666;
    margin-bottom: 10px;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===========================================
   Credits Section
   =========================================== */

.credits-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    align-items: flex-start;
}

.credits-card {
    flex: 1;
    min-width: 300px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    padding: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.credits-info {
    flex: 1;
    min-width: 150px;
}

.credits-count {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.credits-number {
    font-size: 48px;
    font-weight: 300;
    color: #27ae60;
    line-height: 1;
}

.credits-number.credits-zero {
    color: #e74c3c;
}

.credits-number.credits-low {
    color: #f39c12;
}

.credits-label {
    font-size: 16px;
    color: #666666;
}

.credits-details {
    font-size: 13px;
    color: #999999;
}

/* Credits CTA blocks */
.credits-cta {
    flex: 1;
    min-width: 250px;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.credits-cta-quiz {
    background: linear-gradient(135deg, #fff9e6 0%, #fff5cc 100%);
    border: 1px solid #f0d080;
}

.credits-cta-request {
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f0ff 100%);
    border: 1px solid #b8d4f0;
}

.credits-cta-pending {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
}

.credits-cta-warning {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    border: 1px solid #f0c080;
    padding: 15px 20px;
}

.cta-content {
    flex: 1;
    min-width: 150px;
}

.cta-title {
    font-size: 15px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 5px;
}

.cta-description {
    font-size: 13px;
    color: #666666;
    line-height: 1.5;
}

.cta-warning {
    font-size: 14px;
    font-weight: 600;
    color: #d35400;
    margin: 0;
}

.btn-quiz {
    white-space: nowrap;
}

.btn-request-credits {
    white-space: nowrap;
}

/* Quiz result badge */
.quiz-result-badge {
    background: linear-gradient(135deg, #f8f0ff 0%, #f0e6ff 100%);
    border: 1px solid #d4b8f0;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-label {
    font-size: 13px;
    color: #666666;
}

.badge-value {
    font-size: 15px;
    font-weight: 600;
    color: #8e44ad;
}

/* Request Credits Modal */
.request-credits-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.request-credits-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.request-modal-content {
    background: #ffffff;
    padding: 40px;
    max-width: 500px;
    width: 90%;
}

.request-modal-content h3 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 10px;
    color: #000000;
}

.request-modal-content .subtitle {
    font-size: 14px;
    color: #666666;
    margin-bottom: 30px;
}

.request-form .form-group {
    margin-bottom: 20px;
}

.request-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.request-form label .required {
    color: #e74c3c;
}

.request-form select,
.request-form input,
.request-form textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    border: 1px solid #e5e5e5;
    background: #ffffff;
    font-family: inherit;
    transition: border-color 0.3s;
}

.request-form select:focus,
.request-form input:focus,
.request-form textarea:focus {
    outline: none;
    border-color: #000000;
}

.request-form textarea {
    resize: vertical;
    min-height: 80px;
}

.request-form .form-hint {
    font-size: 12px;
    color: #999999;
    margin-top: 5px;
}

.request-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.request-actions .btn {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .my-tryons-header h1 {
        font-size: 28px;
    }

    .tryons-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 30px;
    }

    .delete-actions,
    .error-actions {
        flex-direction: column;
    }

    .access-options {
        grid-template-columns: 1fr;
    }

    .credits-section {
        flex-direction: column;
    }

    .credits-card {
        min-width: auto;
        width: 100%;
    }

    .credits-cta {
        min-width: auto;
        width: 100%;
        flex-direction: column;
        text-align: center;
    }

    .request-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .my-tryons-header h1 {
        font-size: 24px;
    }

    .tryons-grid {
        grid-template-columns: 1fr;
    }

    .tryon-actions {
        padding: 15px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 12px;
    }
}
