/* Mobile App CSS for OutfitAI */

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    background: #f8fafc;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Mobile container */
.mobile-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0;
}

.mobile-app {
    width: 100%;
    max-width: 414px;
    min-height: 100vh;
    background: #ffffff;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header */
.mobile-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

/* Main content area */
.mobile-content {
    padding: 0 0 80px 0;
    min-height: calc(100vh - 140px);
    overflow-y: auto;
}

/* Flash messages */
.flash-messages {
    padding: 0.5rem 1rem;
}

.flash-messages .alert {
    border-radius: 12px;
    border: none;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 414px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem 0;
    z-index: 1000;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 2rem;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #64748b;
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 12px;
    min-width: 60px;
}

.nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

.nav-item.active {
    color: #6366f1;
    background: #f1f5f9;
}

.nav-item:hover {
    color: #6366f1;
    text-decoration: none;
    background: #f8fafc;
}

/* Floating Action Button */
.fab-container {
    position: fixed;
    bottom: 90px;
    right: calc(50% - 207px + 20px); /* Center the mobile container and offset from right */
    z-index: 999;
}

/* For screens smaller than mobile container width */
@media (max-width: 414px) {
    .fab-container {
        right: 20px;
    }
}

.fab {
    width: 56px;
    height: 56px;
    background: #6366f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.fab:hover {
    background: #5855eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
    color: white;
    text-decoration: none;
}

.fab i {
    font-size: 1.5rem;
}

/* Content sections */
.content-section {
    padding: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    overflow: hidden;
}

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

.card-img-top {
    border-radius: 0;
    aspect-ratio: 1;
    object-fit: cover;
}

/* Wardrobe table selector */
.table-selector {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.table-pills {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem 0;
}

.table-pill {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.table-pill.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.table-pill:hover {
    border-color: #6366f1;
    color: #6366f1;
    text-decoration: none;
}

/* Type selector */
.type-selector {
    padding: 1rem 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.type-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 0.25rem;
}

.type-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.type-tab.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Items grid */
.items-grid {
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.item-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

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

.item-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.item-info {
    padding: 0.75rem;
}

.item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.item-meta {
    font-size: 0.75rem;
    color: #64748b;
}

.item-badge {
    display: inline-block;
    background: #f1f5f9;
    color: #6366f1;
    padding: 0.125rem 0.5rem;
    border-radius: 6px;
    font-size: 0.625rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Forms */
.form-container {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-primary:hover {
    background: #5855eb;
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

/* Outfit suggestion layout */
.outfit-container {
    padding: 1.5rem;
}

.outfit-form {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.outfit-result {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.outfit-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.outfit-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.outfit-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.outfit-description {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.875rem;
    color: #0c4a6e;
}

/* Virtual try-on */
.model-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem 1.5rem;
}

.model-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.model-card:hover,
.model-card.selected {
    border-color: #6366f1;
    transform: scale(1.02);
}

.model-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.model-info {
    padding: 0.75rem;
    text-align: center;
}

.result-container {
    padding: 1.5rem;
    text-align: center;
}

.result-image {
    width: 100%;
    max-width: 300px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    z-index: 100000;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

.item-detail-image {
    text-align: center;
    margin-bottom: 1.5rem;
}

.item-detail-image img {
    width: 100%;
    max-width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.detail-label {
    font-weight: 600;
    color: #374151;
    min-width: 80px;
}

.detail-value {
    color: #6b7280;
    text-align: right;
    flex: 1;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    flex: 1;
}

.tag-badge {
    background: #f1f5f9;
    color: #6366f1;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Success Modal */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.success-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

.success-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.success-message {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.success-button {
    background: #6366f1;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.success-button:hover {
    background: #5855eb;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
}

.empty-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 375px) {
    .mobile-app {
        max-width: 100%;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .model-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Utility classes */
.text-center { text-align: center; }
.text-muted { color: #64748b; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }

/* Upload Section Styles */
.upload-section {
    margin-bottom: 1.5rem;
}

.upload-card {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-card:hover {
    border-color: #6366f1;
    background: #f8fafc;
}

.upload-label {
    cursor: pointer;
    display: block;
    margin: 0;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-content h6 {
    color: #1e293b;
    font-weight: 600;
    margin: 0;
}

.upload-content p {
    margin: 0;
    font-size: 0.875rem;
}
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
