/* Depibey OS v14.0 - Photoshop UI Stylesheet */

:root {
    --ps-bg-dark: #1e1e1e;
    --ps-bg-medium: #2b2b2b;
    --ps-bg-light: #353535;
    --ps-border: #1a1a1a;
    --ps-text: #b8b8b8;
    --ps-text-bright: #e8e8e8;
    --ps-accent: #2c8cff;
    --ps-hover: #404040;
    --ps-active: #505050;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--ps-bg-dark);
    color: var(--ps-text);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* PRELOADER */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--ps-bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.preloader-logo {
    font-size: 56px;
    font-weight: 700;
    color: var(--ps-accent);
    margin-bottom: 30px;
    animation: logoAppear 1s ease-out;
    text-shadow: 0 0 20px rgba(44, 140, 255, 0.5);
    letter-spacing: 3px;
}

.preloader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--ps-bg-medium);
    border-top: 4px solid var(--ps-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 20px rgba(44, 140, 255, 0.3);
}

.preloader-text {
    margin-top: 25px;
    font-size: 14px;
    color: var(--ps-text);
    animation: textFade 1.5s ease-in-out infinite;
    letter-spacing: 2px;
}

@keyframes logoAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-50px);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(0.98);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes textFade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* MAIN LAYOUT */
.photoshop-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* TOP MENU BAR */
.ps-menubar {
    background: var(--ps-bg-medium);
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid var(--ps-border);
    user-select: none;
}

.ps-menu-item {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--ps-text-bright);
    cursor: pointer;
    transition: background 0.2s;
}

.ps-menu-item:hover {
    background: var(--ps-hover);
}

.ps-menu-title {
    margin-left: auto;
    font-size: 12px;
    color: var(--ps-text);
    font-weight: 600;
}

/* MAIN WORKSPACE */
.ps-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* LEFT TOOLBAR */
.ps-toolbar {
    width: 60px;
    background: var(--ps-bg-medium);
    border-right: 1px solid var(--ps-border);
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
}

.ps-tool-separator {
    width: 40px;
    height: 1px;
    background: var(--ps-border);
    margin: 5px auto;
    opacity: 0.5;
}

.ps-tool {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ps-bg-light);
    border: 1px solid var(--ps-border);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.ps-tool:hover {
    background: var(--ps-hover);
    border-color: var(--ps-accent);
    transform: translateX(2px);
}

.ps-tool.active {
    background: var(--ps-active);
    border-color: var(--ps-accent);
    box-shadow: 0 0 10px rgba(44, 140, 255, 0.3);
}

.ps-tool svg,
.ps-tool i {
    width: 26px;
    height: 26px;
    stroke: var(--ps-text-bright);
    fill: var(--ps-text-bright);
    transition: all 0.2s;
}

.ps-tool:hover svg,
.ps-tool:hover i {
    stroke: var(--ps-accent);
    fill: var(--ps-accent);
    color: var(--ps-accent);
    transform: scale(1.1);
}

.ps-tool.active svg,
.ps-tool.active i {
    stroke: var(--ps-accent);
    fill: var(--ps-accent);
    color: var(--ps-accent);
}

/* Tooltip for toolbar items */
.ps-tool::after {
    content: attr(title);
    position: absolute;
    left: 65px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--ps-bg-dark);
    color: var(--ps-text-bright);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
    border: 1px solid var(--ps-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.ps-tool:hover::after {
    opacity: 1;
}

/* CANVAS AREA */
.ps-canvas-area {
    flex: 1;
    background: var(--ps-bg-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ps-tabs {
    background: var(--ps-bg-medium);
    height: 36px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--ps-border);
    overflow-x: auto;
}

.ps-tab {
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--ps-text);
    border-right: 1px solid var(--ps-border);
    cursor: pointer;
    background: var(--ps-bg-light);
    white-space: nowrap;
    transition: background 0.2s;
}

.ps-tab.active {
    background: var(--ps-bg-dark);
    color: var(--ps-text-bright);
}

.ps-tab:hover {
    background: var(--ps-hover);
}

.ps-canvas {
    flex: 1;
    overflow: auto;
    background: var(--ps-bg-dark);
    background-image: 
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    padding: 20px;
    position: relative;
}

.canvas-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.intro-logo {
    font-size: 72px;
    font-weight: 700;
    color: var(--ps-accent);
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(44, 140, 255, 0.5);
}

.intro-text {
    font-size: 18px;
    color: var(--ps-text);
}

.intro-version {
    margin-top: 10px;
    font-size: 14px;
    color: var(--ps-text);
    opacity: 0.6;
}

/* PROJECT VIEW */
.project-view {
    max-width: 1400px;
    margin: 0 auto;
    display: none;
}

.project-view.active {
    display: block;
}

.project-images {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.project-image-wrapper {
    background: var(--ps-bg-medium);
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.project-image {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    opacity: 0;
    animation: fadeInImage 0.6s ease forwards;
}

.project-image:hover {
    transform: scale(1.02);
}

@keyframes fadeInImage {
    to { opacity: 1; }
}

.project-footer {
    text-align: center;
    margin: 60px 0 40px;
    padding: 40px;
    border-top: 1px solid var(--ps-border);
}

.project-footer h2 {
    font-size: 24px;
    color: var(--ps-text-bright);
    margin-bottom: 10px;
}

.project-footer p {
    font-size: 14px;
    color: var(--ps-text);
}

/* RIGHT PANELS */
.ps-panels {
    width: 320px;
    background: var(--ps-bg-medium);
    border-left: 1px solid var(--ps-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ps-panel {
    border-bottom: 1px solid var(--ps-border);
}

.ps-panel-header {
    padding: 10px 15px;
    background: var(--ps-bg-light);
    font-size: 12px;
    font-weight: 600;
    color: var(--ps-text-bright);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ps-panel-header:hover {
    background: var(--ps-hover);
}

.ps-panel-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.ps-panel.expanded .ps-panel-content {
    max-height: 600px;
    overflow-y: auto;
}

/* LAYERS PANEL */
.layers-panel {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.layers-panel .ps-panel-content {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    padding: 5px;
}

.layer-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 2px;
    background: var(--ps-bg-light);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
}

.layer-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--ps-accent), #1e7ae6);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.layer-item:hover {
    background: var(--ps-hover);
    border-color: var(--ps-accent);
    transform: translateX(5px);
    box-shadow: -2px 0 8px rgba(44, 140, 255, 0.2);
}

.layer-item:hover::before {
    transform: scaleY(1);
}

.layer-item.active {
    background: var(--ps-active);
    border-color: var(--ps-accent);
    transform: translateX(5px);
    box-shadow: -3px 0 12px rgba(44, 140, 255, 0.4);
}

.layer-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.layer-visibility {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-visibility svg {
    width: 16px;
    height: 16px;
    stroke: var(--ps-text);
}

.layer-visibility.hidden svg {
    opacity: 0.3;
}

.layer-thumbnail {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    background: var(--ps-bg-dark);
    border: 1px solid var(--ps-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.layer-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layer-info {
    flex: 1;
    min-width: 0;
}

.layer-name {
    font-size: 13px;
    color: var(--ps-text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layer-type {
    font-size: 11px;
    color: var(--ps-text);
    margin-top: 2px;
}

.layer-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.layer-item:hover .layer-actions {
    opacity: 1;
}

.layer-action {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s;
}

.layer-action:hover {
    background: var(--ps-hover);
}

.layer-action svg {
    width: 14px;
    height: 14px;
    stroke: var(--ps-text);
}

/* LIGHTBOX */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 95%;
    max-height: 95%;
    position: relative;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--ps-bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--ps-bg-light);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ps-hover);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .ps-panels {
        width: 280px;
    }
    
    .ps-toolbar {
        width: 50px;
    }
}

@media (max-width: 768px) {
    .ps-menubar {
        flex-wrap: wrap;
        height: auto;
        padding: 5px;
    }
    
    .ps-menu-item {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .ps-toolbar {
        width: 50px;
        padding: 5px 2px;
        gap: 3px;
    }
    
    .ps-tool {
        width: 46px;
        height: 46px;
    }
    
    .ps-tool::after {
        display: none; /* Hide tooltips on mobile */
    }
    
    .ps-panels {
        position: fixed;
        right: -320px;
        top: 0;
        height: 100vh;
        z-index: 100;
        transition: right 0.3s ease;
    }
    
    .ps-panels.mobile-open {
        right: 0;
    }
}

