:root {
    --dark-black: #1c1c25;
    --medium-black: #25252f;
    --smoke: #c4c4c4;
    --orange-accent: #ff7f50; /* Burnt Sienna - change this to any of the 10 options above */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--dark-black);
    background-image: radial-gradient(circle, rgba(229,229,229,0.03) 20%, transparent 10%), radial-gradient(circle, rgba(229,229,229,0.03) 20%, transparent 10%);
    background-size: .5em .5em;
    background-position: 50% 50%;
    color: var(--smoke);
    line-height: 1.6;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Start narrow (single panel); expand to 1200px only when JS adds .expanded */
.container {
    max-width: 600px;
    width: 100%;
    padding: 20px;
    position: relative;
    overflow: visible;
    transition: max-width 0.3s ease;
}

.container.expanded {
    max-width: 1200px; /* Show both polish panel and result panel */
}


h1 {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    font-size: 2.2rem;
}

.printer-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
}

.polish-container {
    background: var(--orange-accent);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    display: flex;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    width: 600px;
    flex-shrink: 0;
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#messageInput {
    width: 100%;
    padding: 16px;
    border: 16px solid var(--dark-black);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: var(--smoke);
    resize: vertical;
    min-height: 150px;
    height: 150px; /* Set initial height */
    outline: none;
    transition: border-color 0.2s;
    background-color: var(--medium-black);
}

#messageInput:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#messageInput:disabled {
    color: #6c757d;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background-color: #fc7a4d;
    border-radius: 8px;
    box-shadow: 
        inset 4px 4px 2px rgba(0, 0, 0, 0.2),
        inset -3px -3px 2px rgba(255, 255, 255, 0.2);
}

.model-selection {
    display: flex;
    align-items: center;
    gap: 15px;
}

.model-selection label {
    font-weight: 600;
    color: #495057;
    min-width: 50px;
}

.rotary-switch {
    position: relative;
    width: 120px;
    height: 48px;
    background: #e9ecef;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    
}

.rotary-knob {
    position: absolute;
    width: 30px;
    height: 30px;
    background: #007bff;
    border-radius: 50%;
    left: 12px;
    bottom: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 1px 0 #0056b3,
        0 2px 0 #0056b3,
        0 3px 0 #0056b3,
        0 4px 0 #0056b3,
        0 5px 0 #0056b3,
        0 6px 0 #0056b3;
    border: none;
    z-index: 2;
}

.rotary-switch.rotated .rotary-knob {
    left: 76px;
}

.rotary-label {
    position: absolute;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    white-space: nowrap;
}

.rotary-label.left {
    left: -56px;
}

.rotary-label.right {
    left: 56px;
}

.rotary-switch.rotated .rotary-label.left {
    left: 20px;
}

.rotary-switch.rotated .rotary-label.right {
    left: 120px;
}

.checkboxes-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
}

.toggle-btn {
    position: relative;
    width: 32px;
    height: 20px;
    padding: 0;
    background-color: #E0E0E0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 4px 0 #BEBEBE, 0 8px 15px rgba(0,0,0,0.1); /* Start with full shadow depth */
    transform: translateY(0);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover:not(:disabled) {
    box-shadow: 0 2px 0 #BEBEBE, 0 6px 12px rgba(0,0,0,0.1); /* Shadow bottom stays at same point */
    transform: translateY(2px); /* Button moves down, shadow gets shorter */
}

.toggle-btn:active:not(:disabled) {
    box-shadow: 0 1px 0 #BEBEBE, 0 5px 10px rgba(0,0,0,0.1); /* Shadow bottom stays at same point */
    transform: translateY(3px); /* Button moves down more, shadow gets even shorter */
}

.toggle-btn.active {
    background-color: #E0E0E0;
    box-shadow: 0 4px 0 #BEBEBE, 0 8px 15px rgba(0,0,0,0.1);
}

.toggle-btn.active:hover {
    box-shadow: 0 2px 0 #BEBEBE, 0 6px 12px rgba(0,0,0,0.1);
    transform: translateY(2px);
}

.toggle-btn.active:active {
    box-shadow: 0 1px 0 #BEBEBE, 0 5px 10px rgba(0,0,0,0.1);
    transform: translateY(3px);
}

.toggle-btn:not(.active) {
    background-color: #E0E0E0; /* Keep same gray color */
    box-shadow: 0 4px 0 #BEBEBE, 0 8px 15px rgba(0,0,0,0.1); /* Keep same gray shadows */
}

.toggle-btn:not(.active):hover {
    box-shadow: 0 2px 0 #BEBEBE, 0 6px 12px rgba(0,0,0,0.1); /* Keep same gray shadows */
    transform: translateY(2px);
}

.toggle-btn:not(.active):active {
    box-shadow: 0 1px 0 #BEBEBE, 0 5px 10px rgba(0,0,0,0.1); /* Keep same gray shadows */
    transform: translateY(3px);
}

.toggle-glass {
    display: none; /* Remove glass effect completely */
}

.toggle-light {
    width: 20px;
    height: 8px;
    background-color: #007bff;
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.toggle-btn:not(.active) .toggle-light {
    background-color: #6c757d; /* Gray when button is inactive */
}

.checkbox-label span {
    user-select: none;
}

.polish-btn {
    align-self: center;
    padding: 14px 32px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s;
    min-width: 150px;
    box-shadow: 0 6px 0 #0056b3, 0 8px 15px rgba(0,0,0,0.3);
    transform: translateY(0);
}

.polish-btn:hover:not(:disabled) {
    box-shadow: 0 3px 0 #0056b3, 0 4px 10px rgba(0,0,0,0.3);
    transform: translateY(3px);
}

.polish-btn:active:not(:disabled) {
    box-shadow: 0 1px 0 #0056b3, 0 2px 5px rgba(0,0,0,0.3);
    transform: translateY(5px);
}

.polish-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    box-shadow: 0 6px 0 #5a6268, 0 8px 15px rgba(0,0,0,0.3);
    transform: translateY(0);
}

.result {
    width: 600px;
    min-height: 420px;
    height: 90%;
    padding: 30px;
    background-color: #f8f9fa;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    z-index: 1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    box-sizing: border-box;
    flex-shrink: 0;
    margin-left: 0;
    align-self: center;
    clip-path: polygon(
        0% 0%,
        98% 0%,
        100% 2%,
        98% 4%,
        100% 6%,
        98% 8%,
        100% 10%,
        98% 12%,
        100% 14%,
        98% 16%,
        100% 18%,
        98% 20%,
        100% 22%,
        98% 24%,
        100% 26%,
        98% 28%,
        100% 30%,
        98% 32%,
        100% 34%,
        98% 36%,
        100% 38%,
        98% 40%,
        100% 42%,
        98% 44%,
        100% 46%,
        98% 48%,
        100% 50%,
        98% 52%,
        100% 54%,
        98% 56%,
        100% 58%,
        98% 60%,
        100% 62%,
        98% 64%,
        100% 66%,
        98% 68%,
        100% 70%,
        97% 72%,
        100% 74%,
        97% 76%,
        100% 78%,
        97% 80%,
        100% 82%,
        98% 84%,
        100% 86%,
        98% 88%,
        100% 90%,
        98% 92%,
        100% 94%,
        98% 96%,
        100% 98%,
        98% 100%,
        0% 100%
    );
}

.result.slide-in {
    width: 0;
    margin-left: -600px;
    opacity: 1;
    overflow: hidden;
    padding: 0;
}

.result.slide-out {
    width: 600px;
    margin-left: 0;
    opacity: 1;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.result h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.result-text {
    color: #495057;
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.copy-icon {
    cursor: pointer;
    margin-left: 8px;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.copy-icon:hover {
    opacity: 1;
}

.shred-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 1;
}

.shred-sheet {
    position: absolute;
    top: 0;
    left: 25%;
    transform: translate(-50%, 0) translateZ(0);
    background: linear-gradient(
        90deg,
        #f8f9fa 0%, #f8f9fa 2.8%, transparent 2.8%, transparent 3.5%,
        #f5f6f7 3.5%, #f5f6f7 7.2%, transparent 7.2%, transparent 7.9%,
        #f8f9fa 7.9%, #f8f9fa 10.1%, transparent 10.1%, transparent 11.3%,
        #fafbfc 11.3%, #fafbfc 15.8%, transparent 15.8%, transparent 16.4%,
        #f6f7f8 16.4%, #f6f7f8 19.7%, transparent 19.7%, transparent 20.8%,
        #f8f9fa 20.8%, #f8f9fa 24.9%, transparent 24.9%, transparent 25.6%,
        #f4f5f6 25.6%, #f4f5f6 28.3%, transparent 28.3%, transparent 29.7%,
        #f8f9fa 29.7%, #f8f9fa 33.6%, transparent 33.6%, transparent 34.1%,
        #fafbfc 34.1%, #fafbfc 38.4%, transparent 38.4%, transparent 39.8%,
        #f6f7f8 39.8%, #f6f7f8 42.5%, transparent 42.5%, transparent 43.9%,
        #f8f9fa 43.9%, #f8f9fa 47.2%, transparent 47.2%, transparent 47.9%,
        #f5f6f7 47.9%, #f5f6f7 51.8%, transparent 51.8%, transparent 52.7%,
        #f8f9fa 52.7%, #f8f9fa 55.4%, transparent 55.4%, transparent 56.8%,
        #fafbfc 56.8%, #fafbfc 60.9%, transparent 60.9%, transparent 61.3%,
        #f6f7f8 61.3%, #f6f7f8 64.7%, transparent 64.7%, transparent 65.9%,
        #f8f9fa 65.9%, #f8f9fa 69.1%, transparent 69.1%, transparent 70.6%,
        #f4f5f6 70.6%, #f4f5f6 74.2%, transparent 74.2%, transparent 74.8%,
        #f8f9fa 74.8%, #f8f9fa 78.6%, transparent 78.6%, transparent 79.4%,
        #fafbfc 79.4%, #fafbfc 81.9%, transparent 81.9%, transparent 83.2%,
        #f6f7f8 83.2%, #f6f7f8 87.1%, transparent 87.1%, transparent 87.7%,
        #f8f9fa 87.7%, #f8f9fa 90.3%, transparent 90.3%, transparent 91.8%,
        #f5f6f7 91.8%, #f5f6f7 95.4%, transparent 95.4%, transparent 96.1%,
        #f8f9fa 96.1%, #f8f9fa 98.7%, transparent 98.7%, transparent 100%
    );
    opacity: 0;
    will-change: transform, opacity;
    --drop-distance: 600px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
    border-radius: 2px;
    backface-visibility: hidden;
}

@keyframes shredDrop {
    0% { transform: translate(-50%, 0) translateZ(0); opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translate(-50%, var(--drop-distance)) translateZ(0); opacity: 0; }
}

.shred-sheet.animating {
    animation: shredDrop 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .shred-sheet.animating { animation: none; opacity: 0; }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
    
    .polish-container {
        padding: 20px;
        flex-direction: column;
        gap: 20px;
    }
    
    .result {
        padding: 20px;
    }
    
    .polish-container {
        width: 100%;
    }
    
    .result {
        width: 100%;
    }
    
    .result.slide-in {
        width: 0;
        margin-left: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0;
    }
    
    .printer-wrapper {
        flex-direction: column;
    }
    
    .shredded-paper {
        width: 100%;
    }
    
    #messageInput {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 120px;
    }
    
    .options-container {
        padding: 15px;
    }
    
    .model-selection {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    #modelSelect {
        width: 100%;
        min-width: unset;
    }
    
    .polish-btn {
        padding: 12px 24px;
        font-size: 16px;
    }
}
