:root {
    --bg-primary: #ffffff;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --primary-color: #0f172a; /* Solid classy black */
    --accent-color: #10b981; /* Success green */
    
    --scene-a: #000000;
    --scene-b: #334155;
    --scene-c: #64748b;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1.5rem;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2.2rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text-primary);
}

.logo h1 span {
    color: var(--text-secondary);
    font-weight: 300;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    max-width: 600px;
}

/* Progress Tracker */
.progress-container {
    width: 100%;
    max-width: 600px;
    background: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-info span i {
    color: var(--text-primary);
}

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

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Minimalist Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.card-header {
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.card-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

/* Diagnosis Grid Styles */
.diagnosis-grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

.diagnosis-group h3 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.gender-grid {
    grid-template-columns: repeat(2, 1fr);
}

.option-btn {
    background: #ffffff;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    outline: none;
}

.option-btn:hover {
    background: #f8fafc;
    color: var(--text-primary);
    border-color: #94a3b8;
}

.option-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* Button primary styling */
.controls {
    display: flex;
    justify-content: center;
}

.btn {
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 1rem 3rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

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

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

/* Recommendations Card & Grid */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.rec-item {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.rec-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-color: #94a3b8;
}

.rec-img-wrap {
    width: 100%;
    height: 240px;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.rec-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
    border: 1px solid #e2e8f0;
}

.rec-brand-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

.rec-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.rec-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.rec-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.rec-tags {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.tag {
    background: #f1f5f9;
    border-radius: 4px;
    padding: 0.15rem 0.35rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.rec-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.25rem 1.25rem 1.25rem;
}

.btn-sm {
    flex: 1;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.7rem 0;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.btn-buy {
    background: var(--primary-color);
    color: white;
    text-align: center;
}

.btn-buy:hover {
    background: #1e293b;
}

/* Closet Matrix Structure */
.matrix-legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.legend-item {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot.filled {
    background: var(--text-primary);
}

.dot.empty {
    border: 1px dashed var(--text-secondary);
}

.matrix-wrapper {
    overflow-x: auto;
    width: 100%;
}

.matrix-grid-header {
    display: grid;
    grid-template-columns: 120px repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
    min-width: 750px;
}

.grid-corner-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-primary);
    border-bottom: 2px solid #e2e8f0;
}

.column-header {
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--card-border);
}

.column-header h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.column-header span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Rows styling */
.matrix-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 750px;
}

.matrix-row {
    display: grid;
    grid-template-columns: 120px repeat(3, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.row-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 800;
    font-size: 0.85rem;
    background: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
}

.row-label i {
    font-size: 1.1rem;
}

/* Grid Cells for Slots */
.matrix-cell {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 0.5rem;
    background: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 0.75rem;
}

/* Slot Cell Styling */
.closet-slot {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.closet-slot.empty {
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.9rem;
    background: #ffffff;
}

.closet-slot.empty:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f1f5f9;
    transform: translateY(-1px);
}

.closet-slot.filled {
    border: 1px solid var(--primary-color);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.closet-slot.filled:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.slot-tooltip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.2rem 0.3rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.closet-slot.filled:hover .slot-tooltip {
    opacity: 1;
}

/* Remove button for filled slot */
.slot-remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ef4444;
    border: none;
    color: white;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.closet-slot.filled:hover .slot-remove-btn {
    opacity: 1;
}

/* Custom Interactive Recommendation Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    padding: 2rem;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: translateY(20px);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.modal-body {
    overflow-y: auto;
    flex: 1;
}

/* Modal Items Styling */
.modal-item-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-item {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: border-color 0.2s;
}

.modal-item:hover {
    border-color: var(--primary-color);
}

.modal-item-img {
    width: 60px;
    height: 60px;
    background: #f1f5f9;
    border-radius: 8px;
}

.modal-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.modal-item-brand {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-secondary);
}

.modal-item-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-item-price {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
}

.btn-purchase-register {
    background: var(--primary-color);
    color: white;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.2s;
}

.btn-purchase-register:hover {
    background: #1e293b;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    body { padding: 1.5rem 1rem; }
    .logo h1 { font-size: 2.2rem; }
    .card { padding: 1.5rem; }
    .matrix-grid-header, .matrix-row {
        grid-template-columns: 90px repeat(3, 1fr);
        gap: 0.5rem;
    }
    .row-label { font-size: 0.75rem; padding: 0.5rem; }
    .column-header h3 { font-size: 0.85rem; }
}
