/* css/foto.css */
.dark-studio {
    background: #0a0f1a;
    color: #e2e8f0;
}

.studio-container {
    display: flex;
    min-height: calc(100vh - 80px); /* 80px is navbar height */
    padding: 2rem;
    gap: 2rem;
    margin-top: 80px;
    align-items: flex-start;
}

/* Sidebar Controls */
.studio-sidebar {
    width: 320px;
    background: rgba(16, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    color: #00d1b2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}
.sidebar-header p {
    font-size: 0.9rem;
    color: #a0aab2;
}

.controls-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
}

.controls-group h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(0, 209, 178, 0.2), rgba(0, 209, 178, 0.1));
    border: 1px dashed #00d1b2;
    color: #00d1b2;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}
.upload-btn:hover {
    background: rgba(0, 209, 178, 0.2);
}

.helper-text {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.checklist-guide {
    list-style: none;
    padding: 0;
    font-size: 0.85rem;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.checklist-guide li {
    display: flex;
    align-items: center;
}
.checklist-guide li::before {
    content: '•';
    color: #00d1b2;
    margin-right: 0.5rem;
}
.text-danger { color: #f43f5e; font-weight: 600; }

.slider-container label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}
.slider-container label span {
    color: #00d1b2;
    font-weight: 600;
}
input[type=range] {
    width: 100%;
    accent-color: #00d1b2;
    margin-bottom: 1rem;
}

.action-btn {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.outline-btn {
    background: transparent;
    border: 1px solid #7c3aed;
    color: #7c3aed;
}
.outline-btn:hover {
    background: rgba(124, 58, 237, 0.1);
}
.fill-btn {
    background: #00d1b2;
    border: none;
    color: #0f172a;
    box-shadow: 0 0 15px rgba(0, 209, 178, 0.4);
}
.fill-btn:hover {
    background: #00e6c3;
    transform: translateY(-2px);
}
.download-panel {
    border-color: rgba(0, 209, 178, 0.3);
}

/* Workspace / Canvas */
.studio-workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.workspace-wrapper {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.image-settings-panel {
    width: 600px;
    background: rgba(16, 23, 42, 0.6);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.image-settings-panel h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.8rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem 1.5rem;
}

.settings-grid .slider-container label {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}
.settings-grid input[type=range] {
    margin-bottom: 0;
}

.canvas-container {
    width: 600px;
    height: 600px;
    background: #ffffff; /* White bg for visa */
    position: relative;
    overflow: visible;
    cursor: grab;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    /* Adding subtle grid to simulate "empty" state until image loads */
    background-image: 
      linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0),
      linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}
.canvas-container:active {
    cursor: grabbing;
}

#photoCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

/* Interactive Crop Box */
.crop-box {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    border: 2px solid #f43f5e;
    cursor: move;
    z-index: 20;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.6);
}

.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid #f43f5e;
    border-radius: 50%;
    z-index: 25;
}
.nw { top: -6px; left: -6px; cursor: nwse-resize; }
.ne { top: -6px; right: -6px; cursor: nesw-resize; }
.sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.se { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* Guidelines inside the crop box */
.guide {
    position: absolute;
    left: 0;
    width: 100%;
    border-top: 2px dashed rgba(255, 255, 255, 0.7);
    pointer-events: none;
}
.guide::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -10px;
    border-width: 5px 10px 5px 0;
    border-style: solid;
    border-color: transparent;
}
.guide::after {
    content: '';
    position: absolute;
    top: -6px;
    right: -10px;
    border-width: 5px 0 5px 10px;
    border-style: solid;
    border-color: transparent;
}

.guide::after, .guide::before {
    border-right-color: #f43f5e;
    border-left-color: #f43f5e;
}

.line-top { top: 10%; border-color: rgba(244, 63, 94, 0.8); }
.line-eyes { top: 41%; border-color: rgba(250, 204, 21, 0.8); }
.line-eyes::before, .line-eyes::after { border-right-color: #facc15; border-left-color: #facc15; }
.line-bottom { top: 74%; border-color: rgba(244, 63, 94, 0.8); }

.guide[data-label]::before {
    content: attr(data-label);
    position: absolute;
    top: -20px;
    left: 5px;
    font-size: 10px;
    background: rgba(0,0,0,0.7);
    padding: 2px 4px;
    border-radius: 4px;
    color: #fff;
    border: none;
    font-family: sans-serif;
}

.line-center {
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: transparent;
    border-left: 2px dashed rgba(255,255,255,0.4);
}

.workspace-footer {
    margin-top: 1.5rem;
    max-width: 600px;
    text-align: center;
    color: #a0aab2;
    background: rgba(0, 209, 178, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 209, 178, 0.2);
}
.workspace-footer strong {
    color: #00d1b2;
}
