@charset "UTF-8";

/* =========================================
   Base Styles (Inherited from svg-animator.css pattern)
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important;
    /* Hide all cursors globally */
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    color: #fff;
    overflow-x: hidden;
    cursor: none;
    /* Hide default cursor */
}

/* Custom Cursor (Light Ball) */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 12000;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.6), 0 0 20px 5px rgba(255, 255, 255, 0.3);
    mix-blend-mode: screen;
    transition: width 0.3s ease, height 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
    opacity: 0;
}

/* Cursor active state (hover on interactive elements) */
#cursor.active {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 15px 5px rgba(255, 255, 255, 0.8), 0 0 30px 10px rgba(100, 200, 255, 0.5);
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 80%, rgba(100, 100, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 100, 150, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(100, 200, 255, 0.03) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(2%, 2%) rotate(1deg);
    }

    50% {
        transform: translate(-1%, 3%) rotate(-1deg);
    }

    75% {
        transform: translate(-2%, 1%) rotate(0.5deg);
    }
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #fff;
}

.logo-text {
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 3px;
}

.logo-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

/* Layout */
.container {
    position: relative;
    z-index: 1;
    max-width: 1800px;
    margin: 0 auto;
    padding: 120px 40px 60px;
}

.page-title {
    text-align: center;
    margin-bottom: 50px;
}

.page-title h1 {
    font-size: 36px;
    font-weight: 300;
    letter-spacing: 8px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-title p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

.main-layout {
    display: grid;
    grid-template-columns: 350px 1fr 350px;
    gap: 30px;
    align-items: start;
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr 300px;
    }

    .left-column {
        /* Logo list moves to top or separate */
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 1024px) {
    .main-layout {
        display: flex;
        flex-direction: column;
    }
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    font-size: 18px;
    color: rgba(100, 200, 255, 0.8);
}

/* Logo Grid */
.logo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.logo-item {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.logo-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.logo-item.selected {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
}

.logo-item:hover .logo-delete-btn {
    opacity: 1;
}

.logo-delete-btn:hover {
    background: rgba(239, 68, 68, 0.8);
    color: #fff;
    border-color: rgba(239, 68, 68, 1);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

/* Add Button */
.logo-add-btn {
    aspect-ratio: 1;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.2);
}

.logo-add-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.logo-add-btn i {
    font-size: 24px;
    margin-bottom: 5px;
}

.logo-add-btn span {
    font-size: 10px;
}

/* Canvas Area */
.canvas-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    z-index: 5;
    /* Ensure interactivity */
}

.canvas-wrapper.dragover {
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.5) inset;
    background: rgba(79, 70, 229, 0.1);
}

canvas#main-canvas {
    max-width: 100%;
    max-height: 70vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: crosshair;
}

canvas#main-canvas.movable {
    cursor: move;
}

.empty-state {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

/* Upload Card (Target Image) */
.upload-area {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 10;
}

.upload-area:hover {
    background: rgba(255, 255, 255, 0.08);
}

.upload-btn-label {
    display: block;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Controls */
.control-group {
    margin-bottom: 20px;
}

.control-label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

input[type="range"] {
    width: 100%;
    accent-color: #3b82f6;
    background: rgba(0, 0, 0, 0.3);
    height: 4px;
    border-radius: 2px;
}

.format-select {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 5px;
}

.format-select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Color Mode Buttons */
.mode-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.mode-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #fff;
    border: 1px solid rgba(59, 130, 246, 0.5);
}

/* Color Pickers */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 8px;
}

input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Spinner */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    border-radius: 10px;
    backdrop-filter: blur(2px);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

.loading-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Info List */
.info-title {
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
    line-height: 1.5;
    font-weight: 300;
}

.info-list li strong {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

/* Disclaimer (subtle footer notice) */
.disclaimer {
    margin-top: 40px;
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.7;
}

.disclaimer p {
    margin: 0;
}

.disclaimer i {
    margin-right: 6px;
    color: rgba(100, 200, 255, 0.4);
}

.disclaimer strong {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* Invert Button - Negative Film Effect */
#invert-btn {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    transition: all 0.3s ease;
}

#invert-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: invert(0.15);
    -webkit-backdrop-filter: invert(0.15);
    pointer-events: none;
    transition: all 0.3s ease;
}

#invert-btn:not(:disabled):hover::before {
    backdrop-filter: invert(0.4);
    -webkit-backdrop-filter: invert(0.4);
}

#invert-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

#invert-btn.active::before {
    backdrop-filter: invert(0.6);
    -webkit-backdrop-filter: invert(0.6);
}

/* Back Button */
.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

/* Mobile styles */
@media (max-width: 768px) {

    /* Header mobile adjustment - match Image Splitter */
    header {
        padding: 15px 20px;
    }

    .logo-text {
        font-size: 14px;
        letter-spacing: 2px;
    }

    /* Hide QuickStamp sub text on mobile */
    .logo-sub {
        display: none;
    }

    /* Back button - icon only, circle */
    .back-btn {
        padding: 10px;
        width: 38px;
        height: 38px;
        justify-content: center;
    }

    .back-btn-text {
        display: none;
    }

    /* Ensure all cards have same width on mobile */
    .card {
        width: 100% !important;
        min-width: 0 !important;
    }

    .main-layout {
        gap: 15px;
        padding: 100px 15px 30px;
    }

    .canvas-wrapper {
        min-height: 200px;
    }

    .container {
        padding: 90px 15px 30px;
    }

    /* Reduce space between title and cards */
    .page-title {
        margin-bottom: 15px;
    }

    .page-title h1 {
        font-size: 20px;
        letter-spacing: 3px;
    }

    .page-title p {
        font-size: 11px;
    }
}

/* =========================================
   Proto2 New Styles
   ========================================= */

/* Slider with Number Input */
.slider-with-num {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.slider-with-num input[type="range"] {
    flex: 1;
    min-width: 0;
}

.num-input {
    width: 60px;
    min-width: 60px;
    flex-shrink: 0;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    text-align: center;
}

.num-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.num-input:disabled {
    opacity: 0.5;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(18px);
    background: #3b82f6;
}