
.login-card { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); width: 100%; max-width: 360px; text-align: center; }
.login-header { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; }
.login-logo { width: 45px; height: 45px; border-radius: 8px; object-fit: cover; }
.login-card input { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; font-size: 16px; }
.login-card button { width: 100%; padding: 12px; background: #6366f1; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; margin-top: 10px; }

:root { --primary: #6366f1; --bg: #f8fafc; --text: #1e293b; --danger: #ef4444; --success: #10b981; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); -webkit-tap-highlight-color: transparent; display: block; min-height: auto; justify-content: initial; align-items: initial; }
header { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; height: 60px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100; }
.dropdown { position: relative; display: inline-block; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; z-index: 102; }
.user-name-trigger { font-size: 13px; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 4px; padding: 8px 12px; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.user-name-trigger:active { opacity: 0.7; }
.dropdown-content { display: none; position: absolute; right: 0; background-color: #fff; min-width: 130px; box-shadow: 0 8px 16px rgba(0,0,0,0.1); z-index: 103; border-radius: 8px; overflow: hidden; top: 100%; margin-top: 5px; }
.dropdown-content a { color: #475569; padding: 12px 16px; text-decoration: none; display: block; font-size: 13px; font-weight: 500; border-bottom: 1px solid #f1f5f9; }
.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:active { background-color: #f8fafc; color: var(--primary); }
.dropdown-content.show { display: block !important; }
.nav-group { display: flex; background: #f1f5f9; padding: 4px; border-radius: 8px; }
.nav-item { padding: 6px 15px; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none; color: #64748b; border: none; cursor: pointer; background: transparent; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.nav-item.active { background: #fff; color: var(--primary); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
main { max-width: 1200px; margin: 0 auto; padding: 20px; }
.card { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 25px; }
.full-screen-center { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 80vh; }
.gender-selector { display: flex; gap: 60px; align-items: center; width: 80vw; max-width: 900px; justify-content: center; }
.gender-box { cursor: pointer; text-align: center; transition: all 0.3s ease; position: relative; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gender-box img { width: calc((80vw - 60px) / 2); height: calc((80vw - 60px) / 2); max-width: 350px; max-height: 350px; border-radius: 50%; border: 6px solid #fff; box-shadow: 0 10px 25px rgba(0,0,0,0.1); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); object-fit: cover; }
.gender-box p { margin-top: 20px; font-size: 22px; font-weight: 700; color: #64748b; transition: all 0.3s ease; opacity: 0.5; transform: translateY(10px); }
@media (hover: hover) {
    .gender-box:hover img { transform: scale(1.15); box-shadow: 0 15px 35px rgba(99, 102, 241, 0.3); border-color: var(--primary); filter: brightness(1.05); }
    .gender-box:hover p { opacity: 1; transform: translateY(0); color: var(--primary); }
}
@media (max-width: 768px) { .gender-selector { width: 90vw; gap: 20px; } .gender-box img { width: calc((90vw - 20px) / 2); height: calc((90vw - 20px) / 2); max-width: 280px; max-height: 280px; } .gender-box p { opacity: 1; transform: translateY(0); color: var(--primary); font-size: 18px; } }
.table-container { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.thumb { width: 45px; height: 60px; object-fit: cover; border-radius: 4px; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: opacity 0.2s; }
@media (hover: hover) { .thumb:hover { opacity: 0.8; } }
.date-mobile { display: none; }
@media (max-width: 768px) {
    .date-desktop { display: none; }
    .date-mobile { display: inline; }
}
.delete-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    color: #fca5a5;
    transition: all 0.2s ease;
    line-height: 1;
}
@media (hover: hover) {
    .delete-icon:hover {
        color: #ef4444;
        transform: scale(1.15);
    }
}
@media (max-width: 768px) {
    .delete-icon {
        color: #ef4444;
    }
}
.sort-btn {
    cursor: pointer;
    font-size: 10px;
    margin-left: 4px;
    color: #94a3b8;
}
.sort-btn:hover {
    color: var(--primary);
}
.sort-btn.active {
    color: var(--primary);
}
.outfit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.outfit-item { aspect-ratio: 9/16; border-radius: 12px; overflow: hidden; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.05); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.outfit-item img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 768px) { 
    .outfit-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .outfit-item:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(99, 102, 241, 0.2); filter: brightness(1.05); }
}
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000; justify-content: center; align-items: center; padding: 15px; }
.modal-content { background: #fff; width: 100%; max-width: 450px; border-radius: 16px; overflow: hidden; position: relative; }
.preview-img-box { background: #000; min-height: 350px; display: flex; align-items: center; justify-content: center; }
.preview-img-box img { max-width: 100%; max-height: 75vh; }
.btn { padding: 12px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; text-align: center; font-size: 14px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-gen { background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; }
.btn-gen:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn-success { background: var(--success); color: #fff; }
.btn-secondary { background: #e2e8f0; color: #1e293b; border: 1px solid #cbd5e1; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.w-auto { width: auto !important; display: inline-block !important; flex: none !important; }
#loadingOverlay { display: none; position: fixed; inset: 0; background: rgba(255,255,255,0.9); z-index: 2000; flex-direction: column; align-items: center; justify-content: center; }
.spinner { width: 50px; height: 50px; border: 5px solid #f3f3f3; border-top: 5px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.hidden { display: none !important; }
input, select, textarea { font-size: 16px; -webkit-appearance: none; }
.history-list { display: flex; gap: 8px; padding: 5px 2px; transition: transform 0.3s ease; }
.history-carousel { position: relative; display: flex; align-items: center; gap: 10px; }
.history-list-wrapper { flex: 1; overflow: hidden; }
.carousel-arrow { width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s; }
@media (hover: hover) { .carousel-arrow:hover:not(:disabled) { background: #4f46e5; transform: scale(1.1); } }
.carousel-arrow:disabled { background: #cbd5e1; cursor: not-allowed; opacity: 0.6; }
.history-item { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; }
.history-item.selected { border-color: var(--primary); box-shadow: 0 0 8px rgba(99,102,241,0.4); }
.pagination-container { display: flex; justify-content: center; margin-bottom: 20px; }
.pagination-wrapper { display: flex; flex-direction: column; align-items: center; gap: 10px; background: #f8fafc; padding: 12px 20px; border-radius: 10px; }
.page-size-selector { display: flex; align-items: center; gap: 8px; }
.page-size-selector span { font-size: 13px; color: #64748b; font-weight: 500; }
.page-size-btn { padding: 6px 14px; border: 1px solid #e2e8f0; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; color: #64748b; transition: all 0.2s; }
.page-size-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-size-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-numbers { display: flex; align-items: center; gap: 6px; }
.page-btn { min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: #475569; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.page-btn:hover:not(.disabled):not(.active) { border-color: var(--primary); color: var(--primary); background: #f8fafc; }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.disabled { opacity: 0.5; cursor: not-allowed; }
.page-ellipsis { color: #94a3b8; font-size: 13px; padding: 0 4px; }
.page-info { font-size: 12px; color: #64748b; font-weight: 500; }
.page-size-select { padding: 8px 32px 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; font-size: 13px; font-weight: 600; color: #475569; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; transition: all 0.2s; }
.page-size-select:hover { border-color: var(--primary); }
.page-size-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
.history-pagination-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.history-pagination-bottom { display: flex; justify-content: center; align-items: center; margin-top: 15px; margin-bottom: 0; }
.history-pagination-numbers { flex: 1; display: flex; justify-content: center; }
@media (max-width: 768px) { .history-pagination-top { flex-direction: column; gap: 10px; } .history-pagination-numbers { width: 100%; } }
.gender-title { position: fixed; top: 100px; left: 50%; transform: translateX(-50%); z-index: 10; font-size: 28px; font-weight: 700; color: transparent; background: linear-gradient(90deg, var(--primary) 0%, var(--primary) 40%, #c7d2fe 50%, var(--primary) 60%, var(--primary) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; animation: lightSweep 4s ease-in-out infinite; width: 90%; max-width: 600px; text-align: center; white-space: normal; word-wrap: break-word; line-height: 1.3; }
@keyframes lightSweep { 0% { background-position: 100% 0; } 75% { background-position: 0% 0; } 100% { background-position: 0% 0; } }
@media (max-width: 768px) { .gender-title { font-size: 24px; top: 80px; } }
.face-input-area { border: 1px solid #ddd; border-radius: 10px; padding: 15px; margin-bottom: 15px; }
.face-input-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; position: relative; }
.face-input-title { font-size: 14px; font-weight: 600; color: var(--text); }
.help-icon { width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tooltip-desktop { position: absolute; right: 0; top: 100%; margin-top: 8px; background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,0.15); white-space: nowrap; z-index: 100; opacity: 0; visibility: hidden; transition: all 0.2s; }
.help-icon:hover + .tooltip-desktop { opacity: 1; visibility: visible; }
.help-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.help-modal-content { background: rgba(0,0,0,0.8); color: var(--primary); padding: 20px 25px; border-radius: 12px; font-size: 14px; max-width: 80%; text-align: center; }
@media (min-width: 769px) { .help-modal { display: none !important; } }
@media (max-width: 768px) { .tooltip-desktop { display: none !important; } }
.ratio-icon { display: inline-block; background: #999; border-radius: 2px; flex-shrink: 0; }
.ratio-icon.selected { background: #6366f1; }
.ratio-1x1 { width: 16px; height: 16px; }
.ratio-4x3 { width: 18px; height: 13px; }
.ratio-3x4 { width: 13px; height: 18px; }
.ratio-3x2 { width: 18px; height: 12px; }
.ratio-2x3 { width: 12px; height: 18px; }
.ratio-16x9 { width: 18px; height: 10px; }
.ratio-9x16 { width: 10px; height: 18px; }
.ratio-21x9 { width: 18px; height: 8px; }
.ratio-9x21 { width: 8px; height: 18px; }
.ratio-option:hover { background: #f1f5f9; }
.res-btn { transition: all 0.2s; }
.res-btn:hover { background: #f1f5f9; }
.prompt-edit-modal { position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:2000; display:flex; align-items:center; justify-content:center; }
.prompt-edit-content { background:#fff; padding:20px; border-radius:12px; width:90%; max-width:400px; }

/* Daily Limit Styles */
.daily-limit-container {
    margin-bottom: 15px;
}

#genPanel .daily-limit-container {
    padding: 0 15px;
    margin-bottom: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.limit-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: #64748b;
}

.remaining-count {
    font-weight: 600;
    color: var(--primary);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.limit-warning {
    font-size: 12px;
    color: #f59e0b;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Login Page Specific Styles - Moved to end for precedence */
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
body.login-page { 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    background: #f0f2f5; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    width: 100vw; 
    overflow: hidden; /* Prevent scrollbars if not needed */
}

.mobile-text { display: none; }
@media (max-width: 768px) {
    .desktop-text { display: none; }
    .mobile-text { display: inline; }
}
