/* Wardrobe Page Styles */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: #1a1a1a;
    min-height: 100vh;
    font-family: "Arial", "Helvetica Neue", Helvetica, sans-serif;
    color: white;
}

#wardrobe-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 15px;
    gap: 15px;
    position: relative;
}

/* Header */
#wardrobe-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#wardrobe-header h1 {
    margin: 0;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
}

.page-title {
    font-weight: bold;
}

.back-link {
    text-decoration: none;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.back-link:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0px black;
}

/* Main Layout */
#wardrobe-main {
    display: flex;
    flex: 1;
    gap: 20px;
    overflow: hidden;
}

/* Customization Panel */
#customization-panel {
    width: 380px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding-right: 10px;
}

#customization-panel::-webkit-scrollbar {
    width: 6px;
}

#customization-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#customization-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#customization-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Sections */
section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 4px;
    padding: 15px;
    border: 2px solid black;
    box-shadow: 3px 3px 0px black;
}

.section-title {
    margin: 0 0 12px 0;
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    font-weight: bold;
    color: black;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

/* Model Grid */
#model-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.model-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: black;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
}

.model-card:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 2px 2px 0px black;
}

.model-card.selected {
    background: rgba(50, 150, 255, 0.15);
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
}

.model-thumbnail {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    margin-bottom: 8px;
    object-fit: cover;
    border: 2px solid rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.model-name {
    font-weight: 600;
}

/* Color Grid */
#color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.color-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: black;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 500;
}

.color-card:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.color-card.selected {
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
}

.color-thumbnail {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-bottom: 5px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

/* Animation Controls */
#animation-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-select {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    background: white;
    color: black;
    transition: border-color 0.2s ease;
}

.control-select:hover {
    border-color: rgba(0, 0, 0, 0.4);
}

.control-select:focus {
    outline: none;
    border-color: #2196F3;
}

/* Action Buttons */
#action-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    padding: 10px 16px;
    border: 2px solid black;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    color: black;
    box-shadow: 2px 2px 0px black;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0px black;
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 2px 2px 0px black;
}

.action-btn.primary {
    background: #3498db;
    color: white;
    border-color: #2980b9;
    box-shadow: 2px 2px 0px #1a5276;
}

.action-btn.primary:hover {
    background: #2980b9;
    box-shadow: 4px 4px 0px #1a5276;
}

.action-btn.success {
    background: #2ecc71;
    color: white;
    border-color: #27ae60;
    box-shadow: 2px 2px 0px #1e8449;
}

.action-btn.success:hover {
    background: #27ae60;
    box-shadow: 4px 4px 0px #1e8449;
}

/* Preview Panel */
#preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(50, 50, 50, 0.8);
    border-radius: 4px;
    border: 2px solid black;
    box-shadow: 3px 3px 0px black;
    overflow: hidden;
}

#preview-canvas-container {
    flex: 1;
    position: relative;
    min-height: 400px;
}

#preview-canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

#loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

#loading-indicator.hidden {
    display: none;
}

#preview-controls {
    padding: 12px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hint-text {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    color: black;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 2px solid black;
    box-shadow: 2px 2px 0px black;
}

/* Corner Links - consistent with main page */
#corner-links {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

#github-link {
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#github-link:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0px black;
}

/* Responsive Design */
@media (max-width: 900px) {
    #wardrobe-main {
        flex-direction: column;
    }

    #customization-panel {
        width: 100%;
        min-width: unset;
        max-height: 50vh;
        padding-right: 0;
    }

    #preview-panel {
        min-height: 300px;
    }

    #color-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 500px) {
    #wardrobe-container {
        padding: 10px;
    }

    #model-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #color-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .model-thumbnail {
        width: 55px;
        height: 55px;
    }

    .color-thumbnail {
        width: 35px;
        height: 35px;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95);
    color: black;
    border-radius: 4px;
    border: 2px solid black;
    box-shadow: 3px 3px 0px black;
    z-index: 1000;
    animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}
/* Toggle Panel Button */
.toggle-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 200;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid black;
    border-radius: 4px;
    box-shadow: 3px 3px 0px black;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.2s ease;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 4px 4px 0px black;
}

.toggle-btn:active {
    transform: translateY(0);
    box-shadow: 2px 2px 0px black;
}

/* Hidden state for customization panel */
#customization-panel.hidden {
    display: none;
}

/* Fullscreen preview when panel is hidden */
#wardrobe-main.fullscreen-preview {
    justify-content: center;
}

#preview-panel.fullscreen {
    width: 100%;
    max-width: none;
}