@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
}
header h1 { margin: 0; }
header p { margin: 5px 0 0; opacity: 0.9; }

.tool-layout {
    display: flex;
    flex-wrap: wrap;
    padding: 30px;
}

.controls {
    flex: 1;
    min-width: 350px;
    padding-right: 30px;
    border-right: 1px solid #e0e0e0;
}

.output-area {
    flex: 1.5;
    min-width: 400px;
    padding-left: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 512px;
}

fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

legend {
    font-weight: 600;
    padding: 0 10px;
    color: #8e44ad;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #555;
}

input[type="text"], select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

#generate-btn {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    background: #27ae60;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
#generate-btn:hover { background: #2ecc71; transform: translateY(-2px); }

#output-canvas {
    width: 100%;
    max-width: 512px;
    height: auto;
    border-radius: 8px;
    background-color: #eee;
    border: 1px solid #ddd;
}

/* Loading Spinner */
#loading { display: flex; flex-direction: column; justify-content: center; align-items: center; position: absolute; }
.spinner { border: 5px solid #f3f3f3; border-top: 5px solid #8e44ad; border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
#loading-text { margin-top: 15px; font-weight: 600; color: #555; }
.hidden { display: none !important; }

/* Photo Preview */
#photo-preview-container { text-align: center; }
#photo-preview { max-width: 100px; max-height: 100px; border-radius: 50%; border: 2px solid #8e44ad; margin-bottom: 10px; }
#remove-photo-btn { padding: 5px 10px; font-size: 0.8rem; cursor: pointer; }

/* Responsive */
@media (max-width: 900px) {
    .tool-layout { flex-direction: column; }
    .controls { border-right: none; padding-right: 0; margin-bottom: 30px; }
    .output-area { padding-left: 0; }
}