﻿:root {
    --sidebar-width: 10%;
    --toolbar-height: 60px;
    --bg: #111;
    --fg: #f5f5f6;
    --muted: #888;
    --accent: #ff6a00;
    --panel: #233047;
    --btn: #4a4a4b;
    --btn-active: #ff6a00;
    --border: #2e7dd7;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    /*margin: 0;*/
    /*background: var(--bg);*/
    color: var(--fg);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.app {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    /*grid-template-rows: var(--toolbar-height) 1fr;*/
    grid-template-rows: auto 1fr;
    height: 100vh;
}
/* Toolbar */
.toolbar {
    grid-column: 1 / span 3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}

    .toolbar .group {
        display: flex;
        align-items: center;
        gap: 8px;
        padding-right: 8px;
        border-right: 1px solid var(--border);
    }

        .toolbar .group:last-child {
            border-right: none;
        }

.btn {
    background: var(--btn);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 4px 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    user-select: none;
    flex: 0 1 auto;
    min-width: 30px;
    text-align: center;
}

    .btn:hover {
        background: var(--btn-active);
    }

    .btn.active {
        outline: 2px solid var(--accent);
    }

.label {
    color: var(--muted);
    font-size: 12px;
    margin-right: 4px;
}

input[type="file"] {
    color: var(--fg);
}

/* Sidebar */
.sidebar {
    grid-row: 2;
    overflow: auto;
    background: var(--panel);
    border-right: 1px solid var(--border);
    padding: 4px;
}

.thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #2e7dd7;
}

    .thumb:hover {
        background: var(--btn-active);
    }

    .thumb.active {
        background: #233047;
        border-color: var(--accent);
    }

    .thumb canvas {
        width: 90%;
        height: auto;
        border: 1px solid var(--border);
        border-radius: 4px;
        background: #fff;
        margin:4px;
    }

    .thumb .pnum {
        font-size: 12px;
        color: var(--muted);
        text-align: center;
        margin-top: 4px;
    }

/* Viewer */
.viewer {
    grid-row: 2;
    position: relative;
    overflow: auto;
    background: #0d0d0e;
    display: flex;
    align-items: flex-start;
    justify-content:left;
    padding: 10px;
    
}

.page-wrap {
    position: absolute;
    display: inline-block;
    box-shadow: 0 0 0 5px var(--border), 0 8px  10px rgba(0,0,0,0.4);
    background: #fff;
    margin-left: 0;
    margin-top: 0;
}

#pdf-canvas {
    display: block;
    background: #fff;
}

#draw-canvas {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

.hint {
    position: absolute;
    right: 16px;
    bottom: 16px;
    color: var(--muted);
    font-size: 12px;
}

.ort {
    top: -10px;
}
.cnv {
    width: 100%;
}
/* Color buttons */
.color-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    cursor: pointer;
}

    .color-btn.active {
        outline: 2px solid var(--accent);
    }

/* Responsive tweak */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 10%;
    }

    .thumb canvas {
        width: 90%;
        height: auto;
        border: 1px solid var(--border);
        border-radius: 4px;
        background: #fff;
        margin: 4px;
    }
}


@media (max-width: 768px) {
    :root {
        --sidebar-width: 10%;
    }
    .toolbar {
        justify-content: center; /* ortala */
    }

        .toolbar .btn {
            flex: 1; /* satırda eşit paylaşılsın */
        }




    .sidebar {
        width: 100%; /* Daha dar sidebar */
        padding: 5px;
    }
    .viewer {
       
        justify-content: flex-start;
    }
    .thumb {
        flex-direction: column;
        align-items: center;
        gap: 0px;
        padding: 4px;
        width: 100%;
    }

        .thumb canvas {
            display: none; /* Thumbnail gizlenir */
        }

            .thumb .pnum {
                font-size: 12px;
                color: var(--accent);
                font-weight: bold;
                text-align: center;
                width: 100%;
            }
}

