/* Premium Rotate PDF page styling matching tasarim_kodlari/rotate-pdf.html */

#tool-workspace {
    max-width: 1500px;
    margin: 0 auto;
    padding: 10px 0 54px;
}

.main-layout {
    display: grid;
    grid-template-columns: 1.75fr 0.82fr;
    gap: 30px;
    align-items: start;
    width: 100%;
}

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.dropzone {
    border: 2px dashed #a78bfa;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #faf7ff);
    min-height: 215px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone:hover {
    border-color: #FF8A3D;
    background: linear-gradient(180deg, #ffffff, #f5f0ff);
}

.drop-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #FF5A3C, #FF8A3D);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 15px;
}

.dropzone h3 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 700;
}

.dropzone .or {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 12px;
}

.dropzone p {
    margin-top: 14px;
    color: #64748b;
    font-size: 14px;
}

.workspace {
    overflow: hidden;
    margin-bottom: 18px;
}

.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 800;
}

.clear-btn {
    border: none;
    background: transparent;
    color: #ef4444;
    font-weight: 800;
    cursor: pointer;
    transition: opacity 0.2s;
}

.clear-btn:hover {
    opacity: 0.8;
}

.file-row {
    display: grid;
    grid-template-columns: 1fr 190px 210px 46px;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    transition: background 0.2s;
}

.file-row:hover {
    background: #fbfbfe;
}

.file-row.active {
    background: #f5f3ff;
}

.file-main {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pdf-icon {
    width: 44px;
    height: 52px;
    border-radius: 8px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.pdf-icon::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    border-top: 12px solid #fecaca;
    border-left: 12px solid transparent;
    border-radius: 0 8px 0 0;
}

.file-title {
    font-weight: 800;
    margin-bottom: 5px;
    font-size: 15px;
    word-break: break-all;
}

.file-meta {
    color: #64748b;
    font-size: 13px;
}

.select-box {
    position: relative;
}

.select-box select {
    width: 100%;
    height: 42px;
    border: 1px solid #dbe1ea;
    border-radius: 10px;
    padding: 0 32px 0 14px;
    background: #ffffff;
    color: #334155;
    font-weight: 700;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    transition: border 0.2s;
}

.select-box select:focus {
    border-color: #FF8A3D;
    box-shadow: none;
}

.select-box::after {
    content: "⌄";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #64748b;
    pointer-events: none;
    font-weight: bold;
}

.trash-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.trash-btn:hover {
    color: #ef4444;
    border-color: #fca5a5;
    background: #fee2fee2;
}

.preview-section {
    padding: 20px 24px 26px;
    background: #faf8ff;
    border-top: 1px solid #e5e7eb;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.preview-header h3 {
    font-size: 18px;
    font-weight: 800;
}

.select-all {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.select-all input {
    width: 18px;
    height: 18px;
    accent-color: #FF5A3C;
    cursor: pointer;
}

.preview-scroll {
    overflow-x: auto;
    padding-bottom: 10px;
}

.page-thumbs {
    display: flex;
    gap: 18px;
}

.page-thumb {
    width: 118px;
    flex: 0 0 118px;
}

.thumb-card {
    height: 145px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    padding: 12px;
    position: relative;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    transition: border 0.2s, box-shadow 0.2s;
    user-select: none;
}

.thumb-card:hover {
    border-color: #c084fc;
}

.thumb-card.active {
    border: 2px solid #6d28d9;
    background: #fdfcff;
}

.check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: #FF5A3C;
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    z-index: 2;
}

.thumb-card.active .check {
    display: flex;
}

.thumb-page {
    height: 100px;
    border-radius: 7px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.thumb-page canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease-in-out;
    transform-origin: center center;
}

/* Specific rotation styles applied to canvas inside thumbnail */
.thumb-card.rotate-90 .thumb-page canvas {
    transform: rotate(90deg);
}

.thumb-card.rotate-180 .thumb-page canvas {
    transform: rotate(180deg);
}

.thumb-card.rotate-270 .thumb-page canvas {
    transform: rotate(270deg);
}

.rotate-mini {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #ddd6fe;
    background: #ffffff;
    color: #6d28d9;
    font-size: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(109, 40, 217, 0.12);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 3;
}

.rotate-mini:hover {
    background: #ede9fe;
    transform: scale(1.05);
}

.thumb-number {
    text-align: center;
    margin-top: 10px;
    font-weight: 800;
    font-size: 14px;
}

.scrollbar {
    height: 7px;
    background: #e5e7eb;
    border-radius: 99px;
    margin-top: 18px;
    overflow: hidden;
    display: none; /* Auto scrollbar handles it, but keeps bar styled */
}

.scrollbar span {
    display: block;
    width: 55%;
    height: 100%;
    border-radius: 99px;
    background: #cbd5e1;
}

.settings-card {
    padding: 28px;
}

.settings-card h2 {
    font-size: 21px;
    margin-bottom: 26px;
    font-weight: 800;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label,
.section-label {
    display: block;
    color: #0f172a;
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 800;
}

.direction-grid,
.angle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.option-card {
    height: 54px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-weight: 800;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.option-card:hover {
    border-color: #c084fc;
}

.option-card.active {
    border-color: #FF8A3D;
    background: #faf5ff;
    color: #6d28d9;
    box-shadow: 0 8px 20px rgba(255, 138, 61, 0.08);
}

.page-radio-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.radio-block {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    align-items: start;
    cursor: pointer;
}

.radio-dot {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    margin-top: 3px;
    position: relative;
    transition: border-color 0.2s;
}

.radio-block.active .radio-dot {
    border-color: #FF5A3C;
}

.radio-block.active .radio-dot::after {
    content: "";
    position: absolute;
    inset: 4px;
    background: #FF5A3C;
    border-radius: 50%;
}

.radio-title {
    font-weight: 900;
    margin-bottom: 5px;
    font-size: 15px;
}

.radio-desc {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.range-input {
    width: 100%;
    height: 46px;
    margin-top: 12px;
    border: 1px solid #dbe1ea;
    border-radius: 10px;
    padding: 0 14px;
    outline: none;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.2s;
}

.range-input:focus {
    border-color: #FF8A3D;
    box-shadow: none;
}

.example {
    color: #64748b;
    font-size: 12px;
    margin-top: 8px;
}

.angle-grid {
    grid-template-columns: repeat(4, 1fr);
}

.angle-grid .option-card {
    height: 50px;
    font-size: 14px;
}

.apply-option {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    align-items: start;
    margin: 22px 0 26px;
    cursor: pointer;
}

.apply-option input {
    width: 20px;
    height: 20px;
    accent-color: #FF5A3C;
    margin-top: 2px;
    cursor: pointer;
}

.apply-title {
    font-weight: 900;
    margin-bottom: 5px;
    font-size: 14px;
}

.apply-desc {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.btn-primary {
    border: none;
    background: linear-gradient(135deg, #FF5A3C, #FF8A3D);
    color: #ffffff;
    border-radius: 10px;
    padding: 13px 22px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(255, 90, 60, 0.25);
    transition: opacity 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.95;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.rotate-btn {
    width: 100%;
    height: 58px;
    font-size: 17px;
    border-radius: 12px;
}

.safe-note {
    margin-top: 17px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.safe-note strong {
    color: #16a34a;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 38px;
    overflow: hidden;
    width: 100%;
}

.feature {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 28px 34px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.feature:first-child {
    border-radius: 18px 0 0 18px;
}

.feature:last-child {
    border-radius: 0 18px 18px 0;
}

.feature-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.green {
    background: #dcfce7;
    color: #16a34a;
}

.purple {
    background: #f3e8ff;
    color: #FF8A3D;
}

.blue {
    background: #dbeafe;
    color: #2563eb;
}

.feature h3 {
    font-size: 18px;
    margin-bottom: 7px;
    font-weight: 700;
}

.feature p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

/* Animations and Utilities */
.disabled-opacity {
    opacity: 0.5;
    pointer-events: none;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .features {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .feature,
    .feature:first-child,
    .feature:last-child {
        border-radius: 18px;
    }

    .file-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .direction-grid,
    .angle-grid {
        grid-template-columns: 1fr;
    }
}
