* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Meiryo, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 100px rgba(59, 130, 246, 0.1);
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: headerGlow 10s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10%, 10%); }
}

.header h1 {
    position: relative;
    z-index: 1;
    font-size: 36px;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header p {
    position: relative;
    z-index: 1;
    font-size: 16px;
    opacity: 0.95;
    margin: 0;
}

h1 {
    color: white;
    margin-bottom: 20px;
    text-align: center;
    font-size: 28px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

label {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 14px;
}

input[type="file"] {
    display: none;
}

.file-label, button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.file-label:hover, button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.file-label:active, button:active {
    transform: translateY(0);
}

input[type="range"] {
    width: 150px;
    cursor: pointer;
}

.brush-size-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: #60a5fa;
}

.canvas-container {
    position: relative;
    display: inline-block;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background-image: 
        linear-gradient(45deg, #ddd 25%, transparent 25%),
        linear-gradient(-45deg, #ddd 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ddd 75%),
        linear-gradient(-45deg, transparent 75%, #ddd 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.canvas-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 30px;
}

canvas {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
}

.brush-preview {
    position: fixed;
    pointer-events: none;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    z-index: 1000;
    display: none;
}

.info {
    text-align: center;
    color: #cbd5e1;
    margin: 20px 30px 30px 30px;
    font-size: 14px;
}

#dropZone {
    border: 3px dashed #3b82f6;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: #60a5fa;
    font-size: 18px;
    margin: 30px 30px 20px 30px;
    transition: all 0.3s;
    background: rgba(30, 41, 59, 0.4);
}

#dropZone.drag-over {
    background: rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.secondary-button {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.download-button {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.undo-button {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.mode-selector {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 8px;
}

.mode-button {
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(51, 65, 85, 0.8);
    color: #e2e8f0;
}

.mode-button.active {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border-color: #3b82f6;
}

.mode-button:hover {
    transform: scale(1.05);
}
/* Toast Notification Styles */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.2);
    color: white;
    font-weight: 500;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(96, 165, 250, 0.9) 100%);
}

.toast-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(74, 222, 128, 0.9) 100%);
}

.toast-warning {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.9) 0%, rgba(251, 191, 36, 0.9) 100%);
}

.toast-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(248, 113, 113, 0.9) 100%);
}

.toast-confirm {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(139, 92, 246, 0.95) 100%);
    padding: 20px;
}

.toast-message {
    margin-bottom: 12px;
    font-size: 15px;
}

.toast-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.toast-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.toast-btn-confirm {
    background: rgba(255, 255, 255, 0.95);
    color: #6366f1;
}

.toast-btn-confirm:hover {
    background: white;
    transform: scale(1.05);
}

.toast-btn-cancel {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.toast-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

@media (max-width: 600px) {
    #toastContainer {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .toast {
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}