/* PFP Generator Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%), 
                url('images/back.png') center/cover no-repeat fixed;
    min-height: 100vh;
    color: #333;
}

.pfp-generator-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.generator-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem 0;
    text-align: center;
}

.header-content {
    position: relative;
}

.back-button {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.back-button:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.header-content h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.header-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

/* Main Content */
.generator-main {
    flex: 1;
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Upload Section */
.upload-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-container {
    width: 100%;
    max-width: 500px;
}

.upload-area {
    background: rgba(255, 255, 255, 0.1);
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.upload-area:hover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.3);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.upload-area h3 {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.upload-area p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* Canvas Section */
.canvas-section {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.canvas-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.canvas-header h3 {
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
}

.canvas-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

.btn-secondary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-danger {
    background: linear-gradient(45deg, #ff4757, #ff3838);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.6);
}

.canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#filteredCanvas {
    border-radius: 10px;
    cursor: grab;
    max-width: 100%;
    max-height: 70vh;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#filteredCanvas:active {
    cursor: grabbing;
}

/* Controls Panel */
.controls-panel {
    width: 350px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    height: fit-content;
    max-height: 80vh;
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.panel-header h3 {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.panel-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.panel-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.panel-content {
    padding: 1.5rem;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ff6b6b rgba(255, 107, 107, 0.3);
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: #ff6b6b;
    border-radius: 3px;
}

/* Control Groups */
.control-group {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group h4 {
    color: #ff8e53;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Position Controls */
.position-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    align-items: center;
    justify-items: center;
}

.position-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-control {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-control:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.btn-control:active {
    transform: translateY(0) scale(1.02);
}

/* Size Controls */
.size-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-size {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-size:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-size:active {
    transform: translateY(0);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

#sizeDisplay {
    color: white;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* Hoodie Selection */
.hoodie-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.btn-hoodie {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-hoodie:hover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    transform: translateY(-2px);
}

.btn-hoodie.active {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.btn-hoodie img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
}

.btn-hoodie span {
    color: white;
    font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.btn-action {
    background: linear-gradient(45deg, #2ed573, #1e90ff);
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(46, 213, 115, 0.3);
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(46, 213, 115, 0.5);
}

.btn-action:active {
    transform: translateY(0);
}

/* Footer */
.generator-footer {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    text-align: center;
}

.generator-footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .generator-main {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .controls-panel {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .panel-content {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .control-group {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .generator-main {
        padding: 1rem;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .back-button {
        position: relative;
        display: inline-block;
        margin-bottom: 1rem;
    }
    
    .canvas-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .canvas-actions {
        justify-content: center;
    }
    
    .panel-content {
        grid-template-columns: 1fr;
    }
    
    .size-presets {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .position-row {
        justify-content: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-section, .canvas-section, .controls-panel {
    animation: fadeIn 0.6s ease-out;
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ff6b6b;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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