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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffeef8 0%, #e0f7ff 100%);
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    max-width: 1600px;
    margin: 0 auto;
}

.app-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #ff6b9d 0%, #4ecdc4 100%);
    border-radius: 20px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.95;
}

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr 320px;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.upload-panel,
.canvas-section,
.tools-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.upload-panel h2,
.tools-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

.upload-area {
    margin-bottom: 15px;
}

#file-upload {
    display: none;
}

.upload-label {
    display: block;
    padding: 20px;
    background: linear-gradient(135deg, #ffeef8 0%, #e0f7ff 100%);
    border: 3px dashed #ff6b9d;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: #ff6b9d;
}

.upload-label:hover {
    background: linear-gradient(135deg, #ffe0f0 0%, #d0f0ff 100%);
    transform: scale(1.02);
}

.url-upload {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#url-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.3s;
}

#url-input:focus {
    outline: none;
    border-color: #ff6b9d;
}

.btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8fab 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(255, 107, 157, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 107, 157, 0.4);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    margin-top: 15px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    background: linear-gradient(135deg, #4ecdc4 0%, #6ee7dd 100%);
    box-shadow: 0 4px 10px rgba(78, 205, 196, 0.3);
}

.btn-icon {
    padding: 10px 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: #f5f5f5;
    border-color: #ff6b9d;
}

.sample-images {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.sample-images p {
    margin-bottom: 10px;
    font-weight: 600;
    color: #666;
}

.sample-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sensitivity-control {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.sensitivity-control label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #666;
}

.sensitivity-control input[type="range"] {
    width: 100%;
    margin: 10px 0;
}

.sensitivity-control span {
    display: block;
    text-align: center;
    color: #ff6b9d;
    font-weight: 600;
}

.saved-sessions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.saved-sessions h3 {
    margin-bottom: 15px;
    color: #666;
}

.session-item {
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.session-item:hover {
    background: #ffe0f0;
    transform: translateX(5px);
}

.canvas-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.canvas-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.canvas-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border: 4px solid #ff6b9d;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

#outline-canvas,
#coloring-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

#outline-canvas {
    z-index: 1;
    pointer-events: none;
}

#coloring-canvas {
    z-index: 0;
}

.action-bar {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.brush-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.brush-btn {
    padding: 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.brush-btn:hover {
    background: #f9f9f9;
    border-color: #ff6b9d;
}

.brush-btn.active {
    background: linear-gradient(135deg, #ffeef8 0%, #e0f7ff 100%);
    border-color: #ff6b9d;
    font-weight: 600;
}

.brush-size {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.brush-size label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #666;
}

.brush-size input[type="range"] {
    width: 100%;
    margin: 10px 0;
}

.size-preview {
    margin: 15px auto 0;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.color-picker {
    margin-bottom: 20px;
}

.color-picker h3 {
    margin-bottom: 15px;
    color: #666;
}

.color-input {
    width: 100%;
    height: 50px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 15px;
}

.color-palette,
.color-history {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.color-history {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.color-history p {
    grid-column: 1 / -1;
    margin-bottom: 5px;
    font-size: 12px;
    color: #999;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border: 3px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.extra-tools {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.extra-tools .btn.active {
    background: linear-gradient(135deg, #4ecdc4 0%, #6ee7dd 100%);
}

.tips {
    padding: 15px;
    background: #fffbf0;
    border-radius: 8px;
    border-left: 4px solid #ffe66d;
}

.tips h3 {
    margin-bottom: 10px;
    color: #666;
}

.tips ul {
    list-style: none;
    padding: 0;
}

.tips li {
    padding: 5px 0;
    color: #666;
    font-size: 14px;
}

.tips li:before {
    content: "→ ";
    color: #ff6b9d;
    font-weight: bold;
}

.app-footer {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.app-footer p {
    margin: 5px 0;
    color: #666;
}

.app-footer a {
    color: #ff6b9d;
    text-decoration: none;
    font-weight: 600;
}

.app-footer a:hover {
    text-decoration: underline;
}