:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #60a5fa;
    --text-color: #1e3a5f;
    --text-light: #64748b;
    --bg-color: #f0f7ff;
    --white: #ffffff;
    --border-color: #cbd5e1;
    --shadow: 0 2px 10px rgba(59, 130, 246, 0.1);
    --shadow-lg: 0 10px 40px rgba(59, 130, 246, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --transition: all 0.3s ease;
    --accent-light: #dbeafe;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-img {
    height: 70px;
    width: auto;
    object-fit: cover;
    display: block;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.nav-dropdown-btn:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-dropdown-btn svg {
    flex-shrink: 0;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-content a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-dropdown-content a:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-dropdown-content a svg {
    flex-shrink: 0;
    stroke: var(--text-light);
}

.nav-dropdown-content a:hover svg {
    stroke: var(--primary-color);
}

.nav-link-all {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link-all:hover {
    background: rgba(59, 130, 246, 0.1) !important;
}

.nav-dropdown-mega {
    position: static;
}

.mega-dropdown-content {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-top: 3px solid var(--primary-color);
    padding: 30px 40px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-dropdown-mega:hover .mega-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.mega-col h4 {
    font-size: 0.7rem;
    font-weight: 700;
    color: #888;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.mega-tool-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-tool-list li {
    margin-bottom: 2px;
}

.mega-tool-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    color: #333;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mega-tool-list a:hover {
    background: #f8f9fa;
    color: #1a1a1a;
    transform: translateX(2px);
}

.mega-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mega-icon[data-color="red"] { background: #e74c3c; }
.mega-icon[data-color="pink"] { background: #ec407a; }
.mega-icon[data-color="orange"] { background: #ff7043; }
.mega-icon[data-color="brown"] { background: #8d6e63; }
.mega-icon[data-color="rose"] { background: #f48fb1; }
.mega-icon[data-color="green"] { background: #4caf50; }
.mega-icon[data-color="teal"] { background: #009688; }
.mega-icon[data-color="yellow"] { background: #ffc107; }
.mega-icon[data-color="blue"] { background: #2196f3; }
.mega-icon[data-color="coral"] { background: #ff7043; }
.mega-icon[data-color="emerald"] { background: #10b981; }
.mega-icon[data-color="magenta"] { background: #e91e63; }
.mega-icon[data-color="sky"] { background: #03a9f4; }
.mega-icon[data-color="purple"] { background: #9c27b0; }
.mega-icon[data-color="cyan"] { background: #00bcd4; }
.mega-icon[data-color="amber"] { background: #ffa000; }
.mega-icon[data-color="lime"] { background: #8bc34a; }
.mega-icon[data-color="gold"] { background: #ffb300; }
.mega-icon[data-color="crimson"] { background: #dc3545; }
.mega-icon[data-color="indigo"] { background: #3f51b5; }

@media (max-width: 1200px) {
    .mega-dropdown-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .nav-dropdown-mega {
        display: none;
    }
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-color);
    z-index: 1001;
}

.mobile-menu-btn.active .menu-icon {
    display: none;
}

.mobile-menu-btn.active .close-icon {
    display: block !important;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    z-index: 999;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active {
    display: block;
    transform: translateX(0);
}

.mobile-menu-content {
    padding: 20px;
}

.mobile-menu-section {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.mobile-menu-section:last-of-type {
    border-bottom: none;
}

.mobile-menu-section h3 {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    font-weight: 600;
}

.mobile-menu-section a {
    display: block;
    padding: 12px 0;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: color 0.2s ease;
}

.mobile-menu-section a:last-child {
    border-bottom: none;
}

.mobile-menu-section a:hover {
    color: var(--primary-color);
}

.mobile-menu-all-tools {
    display: block;
    text-align: center;
    padding: 16px;
    background: var(--primary-color);
    color: white !important;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-top: 20px;
}

.mobile-menu-all-tools:hover {
    background: var(--primary-dark);
}

@media (max-width: 1024px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}

body.menu-open {
    overflow: hidden;
}

.main {
    flex: 1;
}

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 800;
    color: var(--white);
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    color: var(--white);
    max-width: 600px;
    margin: 0 auto;
}

.tools-section {
    padding: 60px 0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 30px;
    text-align: center;
}

.popular-tools-section {
    padding-bottom: 40px;
}

.all-tools-section {
    padding-top: 40px;
    background: #f8fafc;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.tool-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 4px solid var(--tool-color, var(--primary-color));
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tool-icon {
    width: 50px;
    height: 50px;
    background: var(--tool-color, var(--primary-color));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.tool-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--white);
}

.tool-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.tool-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.features {
    background: var(--white);
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.feature {
    text-align: center;
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--white);
}

.feature h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.feature p {
    color: var(--text-light);
}

.tool-hero {
    background: linear-gradient(135deg, var(--tool-color, var(--primary-color)) 0%, color-mix(in srgb, var(--tool-color, var(--primary-color)) 80%, black) 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.tool-header {
    max-width: 600px;
    margin: 0 auto;
}

.tool-icon-large {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.tool-icon-large svg {
    width: 40px;
    height: 40px;
    stroke: var(--white);
}

.tool-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.tool-hero p {
    opacity: 0.9;
}

.tool-page {
    padding: 30px 0 60px;
    background: var(--bg-color);
    min-height: calc(100vh - 70px);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 30px;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary-color);
}

.tool-title {
    text-align: center;
    margin-bottom: 40px;
}

.tool-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
}

.tool-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.tool-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.tool-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon svg {
    width: 22px;
    height: 22px;
}

.settings-icon {
    background: #f0f0ff;
}

.settings-icon svg {
    stroke: #6366f1;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.upload-zone {
    padding: 50px 30px;
    text-align: center;
    border: 2px dashed var(--border-color);
    margin: 20px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: rgba(231, 76, 60, 0.02);
}

.upload-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(231, 76, 60, 0.05);
}

.upload-icon-wrapper {
    margin-bottom: 20px;
}

.upload-box-icon {
    width: 80px;
    height: 80px;
}

.upload-zone h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.upload-zone p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.btn-select {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.settings-content {
    padding: 24px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.radio-option:hover {
    border-color: #6366f1;
}

.radio-option.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.radio-option input {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    margin-top: 2px;
}

.radio-option.selected .radio-custom {
    border-color: #6366f1;
}

.radio-option.selected .radio-custom::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    background: #6366f1;
    border-radius: 50%;
}

.radio-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 4px;
}

.radio-text small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.input-group {
    margin-top: 16px;
}

.input-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-color);
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #6366f1;
}

.input-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-light);
    font-size: 0.8rem;
}

.position-group,
.crop-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.crop-inputs {
    grid-template-columns: repeat(2, 1fr);
}

.signature-container {
    margin-bottom: 16px;
}

.signature-container canvas {
    width: 100%;
    height: 120px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fafafa;
    cursor: crosshair;
    margin: 8px 0;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-process {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--tool-color, #6366f1) 0%, color-mix(in srgb, var(--tool-color, #6366f1) 80%, black) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-process:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.no-settings {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
}

.file-list {
    padding: 0 20px 20px;
}

.file-list ul {
    list-style: none;
}

.file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.result-area,
.error-area {
    margin-top: 30px;
}

.result-card,
.error-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 50px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.result-card .success-icon,
.error-card .error-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
}

.result-card h2,
.error-card h2 {
    margin-bottom: 10px;
}

.download-buttons {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .tool-columns {
        grid-template-columns: 1fr;
    }
    
    .tool-title h1 {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .position-group {
        grid-template-columns: 1fr;
    }
    
    .crop-inputs {
        grid-template-columns: 1fr;
    }
}

.upload-area {
    max-width: 100%;
}

.dropzone {
    background: var(--white);
    border: 3px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(231, 76, 60, 0.05);
}

.upload-icon {
    width: 60px;
    height: 60px;
    stroke: var(--primary-color);
    margin-bottom: 20px;
}

.dropzone h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.dropzone p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.btn-download {
    background: #27ae60;
    color: var(--white);
}

.btn-download:hover {
    background: #219a52;
}

.file-list {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.file-list h4 {
    margin-bottom: 15px;
}

.file-list ul {
    list-style: none;
}

.file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.file-list li:last-child {
    margin-bottom: 0;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-size {
    color: var(--text-light);
    font-size: 0.85rem;
}

.remove-file {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px;
}

.tool-options {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.option-group {
    margin-bottom: 20px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.option-group input[type="text"],
.option-group input[type="password"],
.option-group input[type="number"],
.option-group select,
.option-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.option-group input:focus,
.option-group select:focus,
.option-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.option-group small {
    display: block;
    color: var(--text-light);
    margin-top: 5px;
    font-size: 0.85rem;
}

.margin-inputs,
.position-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
}

.margin-inputs input,
.position-inputs input {
    text-align: center;
}

.signature-area {
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    padding: 15px;
}

#signatureCanvas {
    width: 100%;
    max-width: 400px;
    height: 150px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: crosshair;
}

.signature-buttons {
    margin-top: 10px;
}

.result-area,
.error-area {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.success-message,
.error-message {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.success-icon {
    width: 80px;
    height: 80px;
    stroke: #27ae60;
    margin-bottom: 20px;
}

.error-icon {
    width: 80px;
    height: 80px;
    stroke: var(--primary-color);
    margin-bottom: 20px;
}

.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.footer {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
    color: var(--white);
    padding: 60px 0 30px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 3fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 280px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.footer-logo .logo-icon {
    width: 32px;
    height: 32px;
    stroke: var(--white);
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.footer-col h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--white);
}

.footer-col h4 svg {
    stroke: var(--primary-color);
}

.footer-col a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 0;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 25px;
    text-align: center;
}

.footer-features {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-features span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-features svg {
    stroke: var(--primary-color);
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-brand {
        max-width: 100%;
        text-align: center;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .footer-links {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-col h4 {
        justify-content: center;
    }
    
    .footer-features {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-features span {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-card {
        padding: 20px;
    }
    
    .dropzone {
        padding: 40px 20px;
    }
    
    .tool-options {
        padding: 20px;
    }
    
    .btn-large {
        width: 100%;
    }
}

input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.thumbnail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px;
    align-items: flex-start;
    min-height: 200px;
}

.thumbnails-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    flex: 1;
}

.thumbnail-item {
    width: 120px;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.thumbnail-item:hover {
    transform: translateY(-2px);
}

.thumbnail-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.thumbnail-item.drag-over {
    transform: scale(1.05);
}

.thumbnail-item.drag-over::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.thumbnail-content {
    width: 120px;
    height: 140px;
    background: #f8f9fa;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.thumbnail-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-icon svg {
    width: 100%;
    height: 100%;
}

.thumbnail-icon.pdf-icon {
    color: #3b82f6;
}

.thumbnail-icon.word-icon {
    color: #2b579a;
}

.thumbnail-icon.excel-icon {
    color: #217346;
}

.thumbnail-icon.ppt-icon {
    color: #d24726;
}

.thumbnail-icon.file-icon {
    color: #7f8c8d;
}

.thumbnail-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.thumbnail-item:hover .thumbnail-remove {
    opacity: 1;
}

.thumbnail-remove svg {
    width: 14px;
    height: 14px;
    stroke: white;
}

.thumbnail-remove:hover {
    background: var(--primary-color);
}

.thumbnail-name {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-color);
    margin-top: 6px;
    word-break: break-word;
    line-height: 1.3;
}

.add-more-btn {
    width: 120px;
    height: 140px;
    background: transparent;
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.add-more-btn:hover {
    background: rgba(231, 76, 60, 0.05);
    border-style: solid;
}

.add-more-btn svg {
    width: 40px;
    height: 40px;
    stroke: var(--primary-color);
    stroke-width: 2;
}

@media (max-width: 600px) {
    .thumbnail-item {
        width: 90px;
    }
    
    .thumbnail-content {
        width: 90px;
        height: 110px;
    }
    
    .add-more-btn {
        width: 90px;
        height: 110px;
    }
    
    .thumbnail-icon {
        width: 45px;
        height: 45px;
    }
}

.advanced-tool .container {
    max-width: 1400px;
}

.advanced-tool-layout {
    display: grid;
    grid-template-columns: 180px 1fr 320px;
    gap: 20px;
    min-height: calc(100vh - 200px);
}

.page-thumbnails-sidebar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.page-thumbnails-sidebar h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-color);
}

.page-thumbnails-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-thumbnail {
    position: relative;
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.page-thumbnail:hover {
    border-color: var(--secondary-color);
}

.page-thumbnail.active {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.page-thumbnail canvas {
    width: 100%;
    display: block;
}

.page-thumbnail .page-num {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.pdf-preview-area {
    background: #e9ecef;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 500px;
    overflow: auto;
}

.range-preview-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.range-group {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.range-label {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.range-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.range-page-thumb {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.range-page-thumb canvas {
    display: block;
}

.range-page-num {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 2px;
}

.split-options-panel,
.signing-options-panel {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.split-options-panel h2,
.signing-options-panel h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.split-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.mode-tab svg {
    width: 18px;
    height: 18px;
}

.mode-tab:hover {
    border-color: var(--secondary-color);
}

.mode-tab.active {
    border-color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
}

.range-mode-options {
    margin-bottom: 16px;
}

.range-type-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.range-type-buttons {
    display: flex;
    gap: 8px;
}

.range-type-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.range-type-btn:hover {
    border-color: var(--secondary-color);
}

.range-type-btn.active {
    background: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

.ranges-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.range-item {
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.range-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 0.9rem;
}

.range-drag-handle {
    cursor: grab;
    color: var(--text-light);
}

.range-delete-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 2px 6px;
}

.range-delete-btn:hover {
    color: #3b82f6;
}

.range-inputs {
    display: flex;
    gap: 12px;
}

.range-input-group {
    flex: 1;
}

.range-input-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.range-input-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.add-range-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-light);
    transition: var(--transition);
    margin-bottom: 16px;
}

.add-range-btn:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.add-range-btn svg {
    width: 16px;
    height: 16px;
}

.merge-ranges-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-color);
    cursor: pointer;
    margin-bottom: 20px;
}

.merge-ranges-checkbox input {
    width: 18px;
    height: 18px;
}

.pages-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.page-select-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.page-select-btn:hover {
    border-color: var(--secondary-color);
}

.page-select-btn.selected {
    background: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

.mode-description {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.btn-split,
.btn-sign {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-split:hover,
.btn-sign:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.btn-split svg,
.btn-sign svg {
    width: 20px;
    height: 20px;
}

.btn-sign {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.btn-sign:hover {
    box-shadow: 0 4px 15px rgba(63, 81, 181, 0.4);
}

.initial-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

.upload-card-centered {
    max-width: 500px;
    width: 100%;
}

.upload-card-centered .upload-zone {
    margin: 0;
    padding: 60px 40px;
}

.sign-layout .pdf-preview-area {
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.sign-layout .pdf-canvas-container {
    flex: 1;
    width: 100%;
    max-width: none;
    min-height: 0;
}

.pdf-canvas-container {
    position: relative;
    background: var(--white);
    box-shadow: var(--shadow);
    max-width: 100%;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.pdf-canvas-container canvas {
    display: block;
}

.signature-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.signature-overlay .signature-placed,
.signature-overlay .field-placed {
    pointer-events: auto;
}

.signature-placed {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border: 2px dashed #3b82f6;
    border-radius: 4px;
}

.signature-remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.page-navigation button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.page-navigation button:hover:not(:disabled) {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.page-navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sign-type-section,
.required-fields-section,
.optional-fields-section {
    margin-bottom: 20px;
}

.section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.sign-type-buttons {
    display: flex;
    gap: 10px;
}

.sign-type-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.sign-type-btn:hover {
    border-color: #3b82f6;
}

.sign-type-btn.active {
    border-color: #3b82f6;
    background: rgba(63, 81, 181, 0.1);
}

.sign-type-btn svg {
    width: 24px;
    height: 24px;
}

.sign-type-btn span {
    font-size: 0.75rem;
    font-weight: 500;
}

.field-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 8px;
}

.field-item:hover {
    border-color: #3b82f6;
    background: rgba(63, 81, 181, 0.05);
}

.field-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
}

.field-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-color);
}

.field-icon.small {
    font-weight: 600;
    font-size: 0.85rem;
}

.field-text {
    display: flex;
    flex-direction: column;
}

.field-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.field-action {
    font-size: 0.75rem;
    color: var(--text-light);
}

.signature-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.signature-name-inputs {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.name-input-group {
    flex: 1;
}

.name-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.name-input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.signature-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.sig-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.sig-tab:hover {
    border-color: #3b82f6;
}

.sig-tab.active {
    border-color: #3b82f6;
    background: rgba(63, 81, 181, 0.1);
    color: #3b82f6;
}

.sig-tab svg {
    width: 16px;
    height: 16px;
}

.signature-tab-content {
    min-height: 180px;
}

.font-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.font-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.font-option:hover {
    border-color: #3b82f6;
}

.font-option:has(input:checked) {
    border-color: #3b82f6;
    background: rgba(63, 81, 181, 0.05);
}

.font-option input {
    display: none;
}

.font-preview {
    font-size: 1.5rem;
}

.font-preview.cursive1 {
    font-family: 'Dancing Script', cursive;
}

.font-preview.cursive2 {
    font-family: 'Great Vibes', cursive;
}

.font-preview.cursive3 {
    font-family: 'Pacifico', cursive;
}

.color-options {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-options label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.color-buttons {
    display: flex;
    gap: 8px;
}

.color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: var(--text-color);
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--text-color);
}

#drawCanvas {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: crosshair;
    background: #fafafa;
    margin-bottom: 10px;
}

.upload-signature-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-signature-zone:hover {
    border-color: #3b82f6;
    background: rgba(63, 81, 181, 0.05);
}

.upload-signature-zone p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.btn-apply {
    padding: 12px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(63, 81, 181, 0.4);
}

@media (max-width: 1024px) {
    .advanced-tool-layout {
        grid-template-columns: 1fr;
    }
    
    .page-thumbnails-sidebar {
        display: none;
    }
    
    .split-options-panel,
    .signing-options-panel {
        order: -1;
    }
}

@media (max-width: 600px) {
    .signature-name-inputs {
        flex-direction: column;
    }
    
    .sign-type-buttons {
        flex-direction: column;
    }
}

.edit-tool-layout {
    grid-template-columns: 120px 1fr 300px;
}

.edit-options-panel {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.edit-options-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.edit-tools-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.edit-tool-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.edit-tool-btn svg {
    width: 18px;
    height: 18px;
}

.edit-tool-btn:hover {
    border-color: #8bc34a;
    background: rgba(139, 195, 74, 0.1);
}

.edit-tool-btn.active {
    background: #8bc34a;
    border-color: #8bc34a;
    color: var(--white);
}

.edit-tool-btn.active svg {
    stroke: var(--white);
}

.text-properties-panel {
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}

.text-properties-panel h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.property-group {
    margin-bottom: 12px;
}

.property-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 6px;
}

.property-group input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.edit-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.edits-summary {
    font-size: 0.9rem;
    color: var(--text-light);
}

.edits-summary span {
    font-weight: 600;
    color: #8bc34a;
}

.btn-edit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 195, 74, 0.4);
}

.btn-edit svg {
    width: 18px;
    height: 18px;
}

.text-blocks-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: auto;
}

.text-block-overlay {
    position: absolute;
    border: 1px dashed transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.text-block-overlay:hover {
    background: rgba(139, 195, 74, 0.15);
    border-color: #8bc34a;
}

.text-block-overlay.edited {
    background: rgba(139, 195, 74, 0.25);
    border: 2px solid #8bc34a;
}

.added-text-overlay {
    position: absolute;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px dashed #3498db;
    border-radius: 4px;
    cursor: move;
    white-space: pre-wrap;
}

.remove-added-text {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.text-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.text-edit-modal-content {
    background: var(--white);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.text-edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.text-edit-modal-header h3 {
    font-size: 1.1rem;
    color: var(--text-color);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.text-edit-modal-body {
    padding: 20px;
}

.text-edit-modal-body textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 16px;
}

.text-edit-options {
    display: flex;
    gap: 16px;
}

.text-edit-options .option-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-edit-options label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.text-edit-options input[type="number"] {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.text-edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 195, 74, 0.3);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
}

.zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.zoom-btn:hover {
    background: #f0f0f0;
    border-color: #8bc34a;
}

.zoom-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-color);
}

#zoomLevel {
    min-width: 50px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.pdf-canvas-container {
    overflow: auto;
}

@media (max-width: 1024px) {
    .edit-tool-layout {
        grid-template-columns: 1fr;
    }
    
    .edit-options-panel {
        order: -1;
    }
    
    .zoom-controls {
        margin-left: 10px;
        padding-left: 10px;
    }
}

.organize-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    min-height: 70vh;
}

.organize-main-area {
    background: #f8f9fa;
    border-radius: var(--radius-md);
    padding: 20px;
}

.organize-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.toolbar-btn:hover {
    background: #f0f0f0;
    border-color: #3b82f6;
}

.toolbar-btn svg {
    width: 18px;
    height: 18px;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 10px;
}

.page-card {
    position: relative;
    background: var(--white);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: grab;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.2);
}

.page-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.page-card.drag-over {
    border-color: #3b82f6;
    background: rgba(26, 188, 156, 0.1);
    transform: scale(1.02);
}

.page-thumbnail-canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.page-number {
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.page-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.page-card:hover .page-delete-btn {
    opacity: 1;
}

.page-delete-btn:hover {
    background: #2563eb;
}

.organize-sidebar {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.organize-sidebar h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--text-color);
}

.files-section {
    margin-bottom: 20px;
}

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

.files-header span {
    font-weight: 500;
    color: var(--text-muted);
}

.reset-btn {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.9rem;
}

.reset-btn:hover {
    text-decoration: underline;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: var(--radius-sm);
    color: white;
}

.file-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.file-item span {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-count-info {
    padding: 16px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--text-muted);
}

.page-count-info span {
    font-weight: 600;
    color: var(--text-color);
}

.btn-organize {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    margin-top: auto;
}

.btn-organize:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.4);
}

.btn-organize svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 900px) {
    .organize-layout {
        grid-template-columns: 1fr;
    }
    
    .organize-sidebar {
        order: -1;
    }
    
    .pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

.merge-tool-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    min-height: 70vh;
}

.merge-files-area {
    background: #fafafa;
    border-radius: var(--radius-md);
    padding: 30px;
    position: relative;
    min-height: 500px;
}

.merge-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.merge-file-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    padding: 15px;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
}

.merge-file-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.merge-file-card.dragging {
    opacity: 0.5;
    transform: scale(1.02);
    cursor: grabbing;
}

.merge-file-card.drag-over {
    border-color: #3b82f6;
    border-style: dashed;
    background: #fff5f5;
}

.merge-file-thumbnail {
    width: 100%;
    height: 180px;
    background: #f5f5f5;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
}

.merge-file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.merge-file-thumbnail svg {
    width: 48px;
    height: 48px;
}

.merge-file-name {
    font-size: 0.85rem;
    color: var(--text-color);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 5px;
}

.merge-file-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.merge-file-card:hover .merge-file-remove {
    opacity: 1;
}

.merge-file-remove:hover {
    background: #2563eb;
}

.merge-actions-floating {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.merge-action-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.merge-action-btn svg {
    width: 24px;
    height: 24px;
}

.merge-action-btn.add-btn {
    background: #3b82f6;
    color: white;
}

.merge-action-btn.add-btn:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.merge-action-btn.sort-btn {
    background: white;
    color: #666;
}

.merge-action-btn.sort-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.merge-sidebar {
    background: white;
    border-radius: var(--radius-md);
    padding: 30px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.merge-sidebar h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

.merge-instructions {
    background: #e8f4fd;
    border-radius: var(--radius-sm);
    padding: 15px;
    font-size: 0.95rem;
    color: #2980b9;
    line-height: 1.5;
    margin-bottom: 20px;
}

.merge-file-count {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.merge-file-count span {
    font-weight: 600;
    color: var(--text-color);
}

.btn-merge {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    margin-top: auto;
}

.btn-merge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-merge:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-merge svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 900px) {
    .merge-tool-layout {
        grid-template-columns: 1fr;
    }
    
    .merge-sidebar {
        order: -1;
    }
    
    .merge-files-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .merge-actions-floating {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        z-index: 100;
    }
}

.crop-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    min-height: 70vh;
}

.crop-preview {
    background: #f8f9fa;
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.crop-preview .pdf-canvas-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    width: 100%;
}

.crop-preview .pdf-canvas-wrapper {
    position: relative;
    display: inline-block;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
}

.crop-selection {
    position: absolute;
    border: 2px dashed #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    cursor: move;
    display: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    z-index: 10;
}

.crop-selection .crop-drag-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: move;
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid #e74c3c;
    border-radius: 2px;
    z-index: 20;
    pointer-events: auto;
}

.crop-handle.top-left {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.crop-handle.top-right {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.crop-handle.bottom-left {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.crop-handle.bottom-right {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}

.crop-handle.top-center {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.crop-handle.bottom-center {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.crop-handle.left-center {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.crop-handle.right-center {
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.crop-options-panel {
    background: white;
    border-radius: var(--radius-md);
    padding: 30px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.crop-options-panel h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.crop-instruction {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.reset-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 30px;
    display: inline-block;
}

.reset-link:hover {
    text-decoration: underline;
}

.crop-pages-section {
    margin-bottom: 30px;
}

.crop-page-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: var(--transition);
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
}

.radio-label {
    color: var(--text-color);
}

.crop-dimensions {
    margin-bottom: 30px;
}

.dimension-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.dimension-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dimension-group label {
    font-size: 0.85rem;
    color: var(--text-light);
    min-width: 40px;
}

.dimension-group input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.dimension-group span {
    font-size: 0.8rem;
    color: var(--text-light);
}

.btn-crop {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    margin-top: auto;
}

.btn-crop:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-crop:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-crop svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 900px) {
    .crop-layout {
        grid-template-columns: 1fr;
    }
    
    .crop-options-panel {
        order: -1;
    }
}

/* ========================================
   ROTATE PDF TOOL STYLES
   ======================================== */

.rotate-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    min-height: 70vh;
}

.rotate-pages-area {
    background: #f8f9fa;
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: auto;
    max-height: 75vh;
}

.rotate-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.rotate-page-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.rotate-page-item.selected .rotate-thumbnail-wrapper {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.rotate-thumbnail-wrapper {
    position: relative;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    padding: 10px;
    transition: var(--transition);
    overflow: hidden;
}

.rotate-thumbnail-wrapper:hover {
    border-color: #bbb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rotate-thumbnail-wrapper:hover .rotate-overlay-controls {
    opacity: 1;
}

.rotate-page-canvas {
    display: block;
    max-width: 120px;
    max-height: 160px;
    transition: transform 0.3s ease;
}

.rotate-overlay-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.rotate-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rotate-arrow:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.rotate-arrow svg {
    color: #333;
}

.rotate-page-number {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.rotate-page-label {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.add-more-btn-floating {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    transition: var(--transition);
}

.add-more-btn-floating:hover {
    transform: scale(1.1);
}

.add-more-btn-floating svg {
    width: 24px;
    height: 24px;
}

.rotate-options-panel {
    background: white;
    border-radius: var(--radius-md);
    padding: 30px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.rotate-options-panel h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.rotate-instruction {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.rotation-section {
    margin-bottom: 30px;
}

.rotation-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.rotation-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.rotation-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.rotation-btn svg {
    color: #ef4444;
}

.rotation-btn span {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.btn-rotate {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    margin-top: auto;
}

.btn-rotate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-rotate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-rotate svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 900px) {
    .rotate-layout {
        grid-template-columns: 1fr;
    }
    
    .rotate-options-panel {
        order: -1;
    }
    
    .rotate-pages-area {
        max-height: 50vh;
    }
}

/* ========================================
   PDF EDITOR - PROFESSIONAL TOOLBAR STYLES
   ======================================== */

.editor-page {
    min-height: 100vh;
    background: #f0f2f5;
    padding: 0;
}

.editor-page .container-fluid {
    max-width: 100%;
    padding: 0 20px;
}

.editor-back {
    position: absolute;
    top: 80px;
    left: 20px;
    z-index: 100;
}

.editor-workspace {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
    padding-top: 20px;
    position: relative;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
    background: white;
    padding: 8px 15px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 3px;
}

.toolbar-divider {
    width: 1px;
    height: 30px;
    background: #e0e0e0;
    margin: 0 8px;
}

.toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: #555;
    font-size: 0.75rem;
    transition: all 0.2s;
    min-width: 60px;
}

.toolbar-btn svg {
    width: 20px;
    height: 20px;
}

.toolbar-btn .dropdown-arrow {
    width: 12px;
    height: 12px;
    margin-left: 2px;
    display: inline;
}

.toolbar-btn:hover {
    background: #f5f7fa;
    border-color: #ddd;
}

.toolbar-btn.active {
    background: #e8f0fe;
    border-color: #4285f4;
    color: #1967d2;
}

.toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.editor-page-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 15px;
}

.page-bar-left, .page-bar-right {
    flex: 1;
}

.page-bar-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-bar-right {
    display: flex;
    justify-content: flex-end;
}

.page-number-display {
    background: #f5f7fa;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: #333;
    min-width: 40px;
    text-align: center;
}

.page-bar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f5f7fa;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
}

.page-bar-btn:hover {
    background: #e8f0fe;
    border-color: #4285f4;
    color: #1967d2;
}

.page-bar-btn svg {
    width: 18px;
    height: 18px;
}

.zoom-group {
    display: flex;
    gap: 2px;
    background: #f5f7fa;
    border-radius: var(--radius-sm);
    padding: 2px;
}

.zoom-group .page-bar-btn {
    border: none;
    background: transparent;
}

.insert-page-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #e8f0fe;
    border: 1px solid #4285f4;
    border-radius: var(--radius-sm);
    color: #1967d2;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.insert-page-btn:hover {
    background: #d2e3fc;
}

.insert-page-btn svg {
    width: 16px;
    height: 16px;
}

.editor-canvas-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background: #e8eaed;
    border-radius: var(--radius-md);
    overflow: auto;
    min-height: 500px;
}

.editor-canvas-wrapper {
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: white;
    width: 100%;
    max-width: 100%;
}

.editor-canvas-wrapper canvas {
    display: block;
}

.editor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: auto;
}

.editor-page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: var(--radius-md);
    margin-top: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.page-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f5f7fa;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
}

.page-nav-btn:hover:not(:disabled) {
    background: #e8f0fe;
    border-color: #4285f4;
    color: #1967d2;
}

.page-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-nav-btn svg {
    width: 20px;
    height: 20px;
}

.page-nav-info {
    font-size: 0.95rem;
    color: #555;
    min-width: 100px;
    text-align: center;
}

.apply-changes-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #f4a825 0%, #d69c22 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(244, 168, 37, 0.4);
    transition: all 0.3s;
    z-index: 1000;
}

.apply-changes-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 168, 37, 0.5);
}

.apply-changes-btn svg {
    width: 18px;
    height: 18px;
}

.edit-element {
    position: absolute;
    cursor: grab;
    user-select: none;
}

.edit-element:hover {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

.edit-text {
    padding: 2px 4px;
    white-space: pre-wrap;
}

.edit-image img,
.edit-signature img {
    display: block;
    pointer-events: none;
}

.edit-whiteout {
    background: white;
    border: 1px dashed #ccc;
}

.edit-shape {
    background: transparent;
}

.edit-remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.edit-element:hover .edit-remove-btn {
    display: flex;
}

.whiteout-preview,
.shape-preview {
    position: absolute;
    border: 2px dashed #4285f4;
    background: rgba(66, 133, 244, 0.1);
    pointer-events: none;
}

.whiteout-preview {
    background: rgba(255, 255, 255, 0.8);
}

/* Modal Styles */
.text-input-modal,
.image-upload-modal,
.signature-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content.modal-lg {
    max-width: 550px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body textarea,
.modal-body input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    resize: vertical;
}

.text-options,
.text-edit-options {
    margin-top: 15px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.option-row label {
    min-width: 80px;
    color: #555;
    font-size: 0.9rem;
}

.option-row input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
}

.color-picker {
    display: flex;
    gap: 8px;
}

.color-opt {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.color-opt:hover {
    transform: scale(1.1);
}

.color-opt.active {
    border-color: #333;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #333;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.image-upload-zone {
    border: 2px dashed #ddd;
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.image-upload-zone:hover {
    border-color: #4285f4;
    background: #f8faff;
}

.image-upload-zone svg {
    width: 48px;
    height: 48px;
    color: #999;
    margin-bottom: 10px;
}

.image-upload-zone p {
    color: #666;
    margin: 0;
}

.image-preview {
    margin-top: 15px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
}

.signature-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.sig-tab {
    flex: 1;
    padding: 10px;
    background: #f5f7fa;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sig-tab:hover {
    background: #e8f0fe;
}

.sig-tab.active {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
}

.sig-panel {
    display: none;
}

.sig-panel.active {
    display: block;
}

#signatureCanvas {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    cursor: crosshair;
    touch-action: none;
}

#drawPanel .btn-sm {
    margin-top: 10px;
    padding: 6px 12px;
    font-size: 0.85rem;
}

#typePanel input {
    width: 100%;
    padding: 12px;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

#typePanel select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
}

.sig-upload-zone {
    border: 2px dashed #ddd;
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    cursor: pointer;
}

.sig-upload-zone:hover {
    border-color: #4285f4;
}

@media (max-width: 768px) {
    .editor-toolbar {
        padding: 5px 10px;
    }
    
    .toolbar-btn {
        padding: 6px 8px;
        min-width: 50px;
        font-size: 0.7rem;
    }
    
    .toolbar-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .toolbar-btn span {
        display: none;
    }
    
    .toolbar-divider {
        margin: 0 5px;
    }
    
    .editor-page-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .page-bar-left,
    .page-bar-center,
    .page-bar-right {
        flex: none;
    }
    
    .insert-page-btn span {
        display: none;
    }
    
    .apply-changes-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Inline Edit Toolbar Styles */
.inline-edit-toolbar {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 1000;
}

.inline-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.inline-btn:hover {
    background: #f0f0f0;
    border-color: #ddd;
}

.inline-btn.italic {
    font-style: italic;
}

.inline-btn.underline {
    text-decoration: underline;
}

.inline-divider {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 4px;
}

.inline-dropdown {
    position: relative;
}

.inline-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 120px;
    z-index: 1001;
    padding: 4px;
}

.inline-dropdown-menu.show {
    display: block;
}

.inline-dropdown-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
}

.inline-dropdown-menu button:hover {
    background: #f0f0f0;
}

.inline-dropdown-menu.color-menu {
    display: none;
    flex-wrap: wrap;
    width: 120px;
    padding: 8px;
    gap: 6px;
}

.inline-dropdown-menu.color-menu.show {
    display: flex;
}

.color-swatch {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px;
    padding: 0 !important;
    border-radius: 4px !important;
    border: 2px solid transparent !important;
}

.color-swatch:hover {
    border-color: #333 !important;
    transform: scale(1.1);
}

/* Text Block Overlay Styles */
.text-block-overlay {
    position: absolute;
    border: 2px dashed transparent;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 2px;
}

.text-block-overlay:hover {
    background: rgba(66, 133, 244, 0.1);
    border-color: rgba(66, 133, 244, 0.5);
}

.text-block-overlay.selected {
    background: rgba(66, 133, 244, 0.15);
    border-color: #4285f4;
    border-style: solid;
}

/* Edit Text Modal */
#editTextModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#editTextModal .modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

#editTextModal .modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#editTextModal .modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

#editTextModal .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

#editTextModal .modal-body {
    padding: 20px;
}

#editTextModal .modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Select tool cursor */
.editor-overlay[style*="cursor: text"] .text-block-overlay {
    cursor: text;
}

/* All Tools Page Styles */
.all-tools-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    text-align: center;
    padding: 50px 0;
}

.all-tools-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.all-tools-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.all-tools-page {
    padding: 50px 0 80px;
    background: #f8fafc;
}

.tools-mega-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 30px;
}

.tools-category h3 {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.tools-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tools-list li {
    margin-bottom: 4px;
}

.tools-list a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 10px;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tools-list a:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.tool-chip {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
    margin-top: 2px;
}

.tool-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 2px;
}

.tool-desc {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.3;
}

@media (max-width: 1200px) {
    .tools-mega-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .tools-mega-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .all-tools-hero h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .tools-mega-grid {
        grid-template-columns: 1fr;
    }
}

/* Tool Article Styles */
.tool-article {
    background: #fff;
    padding: 60px 0 80px;
    border-top: 1px solid #e2e8f0;
}

.article-content {
    max-width: 900px;
    margin: 0 auto;
}

.article-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-intro {
    font-size: 1.1rem;
    color: #475569;
    line-height: 1.8;
    margin-bottom: 40px;
}

.article-section {
    margin-bottom: 50px;
}

.article-section h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.features-grid-article {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.feature-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.feature-item:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.feature-icon-small {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-item strong {
    display: block;
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.feature-item p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.how-to-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step-counter;
}

.how-to-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #f1f5f9;
}

.how-to-list li:last-child {
    border-bottom: none;
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-text {
    font-size: 1rem;
    color: #334155;
    line-height: 1.6;
    padding-top: 6px;
}

.use-cases-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.use-cases-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.5;
}

.use-cases-list li svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: #cbd5e1;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #fff;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: #f8fafc;
}

.faq-question svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: #64748b;
}

.faq-item.open .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 300px;
}

.faq-answer p {
    padding: 0 24px 20px;
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .features-grid-article {
        grid-template-columns: 1fr;
    }
    
    .use-cases-list {
        grid-template-columns: 1fr;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-section h3 {
        font-size: 1.2rem;
    }
}

/* Info Pages (About, Contact, Privacy) */
.info-page {
    padding: 60px 0 80px;
    min-height: calc(100vh - 200px);
}

.info-header {
    text-align: center;
    margin-bottom: 48px;
}

.info-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.info-subtitle {
    font-size: 1.1rem;
    color: #64748b;
}

.info-content {
    max-width: 900px;
    margin: 0 auto;
}

.info-section {
    margin-bottom: 36px;
}

.info-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.info-section p {
    font-size: 1rem;
    color: #475569;
    line-height: 1.8;
    margin-bottom: 16px;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 12px 0;
    padding-left: 28px;
    position: relative;
    color: #475569;
    line-height: 1.6;
}

.info-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 50%;
}

.info-list li strong {
    color: #1e293b;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.info-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.info-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.info-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.info-card p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

/* Contact Page */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 48px;
    align-items: start;
}

.contact-methods {
    margin-top: 32px;
}

.contact-method {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 16px;
}

.contact-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-method h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.contact-method p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

.contact-form-wrapper {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    color: #1e293b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Privacy Page */
.privacy-content .info-section {
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
}

.privacy-content .info-section h2 {
    border-bottom: none;
    margin-bottom: 12px;
    padding-bottom: 0;
}

.privacy-content .info-section a {
    color: #3b82f6;
    text-decoration: none;
}

.privacy-content .info-section a:hover {
    text-decoration: underline;
}

/* Footer Info Links */
.footer-info-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 24px 0;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-info-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-info-links a:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .info-header h1 {
        font-size: 2rem;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-info-links {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* Footer Social Icons */
.footer-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 20px 0;
}

.social-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-3px);
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

/* Modified text block styles */
.text-block-overlay.modified {
    border: 2px solid #4caf50 !important;
    background: rgba(76, 175, 80, 0.1) !important;
}

.modified-text-preview {
    border-left: 3px solid #4caf50;
}

.live-text-preview {
    animation: pulse-preview 1s ease-in-out infinite alternate;
}

@keyframes pulse-preview {
    from { box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
    to { box-shadow: 0 2px 12px rgba(76, 175, 80, 0.4); }
}

/* Enhanced Browse Files Button for Edit PDF */
.editor-page .btn-upload,
.editor-page .upload-zone .btn-upload {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 40px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.editor-page .btn-upload::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.editor-page .btn-upload:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.editor-page .btn-upload:hover::before {
    left: 100%;
}

.editor-page .btn-upload:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.editor-page .upload-zone {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    border: 3px dashed #667eea;
    border-radius: 20px;
    padding: 60px 40px;
}

.editor-page .upload-zone:hover {
    border-color: #764ba2;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
}

.editor-page .upload-zone h4 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 10px;
}

.editor-page .upload-zone p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 25px;
}

.editor-page .upload-icon-wrapper svg {
    width: 90px;
    height: 90px;
}

.editor-page .upload-icon-wrapper svg path {
    stroke: #667eea;
    stroke-width: 2.5;
}

/* Compression Tool Styles */
.compression-info {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid #4caf50;
}

.compression-note {
    color: #2e7d32;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

.compression-options .radio-option {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    background: #fff;
}

.compression-options .radio-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.compression-options .radio-option.selected {
    border-color: #4caf50;
    background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.15);
}

.compression-options .radio-option.extreme:hover {
    border-color: #ff5722;
}

.compression-options .radio-option.less:hover {
    border-color: #2196f3;
}

.compression-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: #e0e0e0;
    color: #666;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compression-options .extreme .compression-badge {
    background: linear-gradient(135deg, #ff5722 0%, #ff7043 100%);
    color: white;
}

.compression-options .recommended .compression-badge,
.compression-badge.recommended-badge {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
}

.compression-options .less .compression-badge {
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    color: white;
}

.compression-options .radio-text strong {
    font-size: 1.05rem;
    color: #333;
}

.compression-options .radio-text small {
    display: block;
    color: #666;
    margin-top: 4px;
    line-height: 1.4;
}

/* Resize Handle for PDF Editor */
.resize-handle {
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    position: absolute;
    right: -6px;
    bottom: -6px;
    cursor: nwse-resize;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
    z-index: 100;
    transition: transform 0.2s ease;
}

.resize-handle:hover {
    transform: scale(1.2);
    background-color: var(--primary-dark);
}

/* Ensure edit elements are positioned correctly */
.edit-element {
    position: absolute;
    box-sizing: border-box;
    /* Ensure handle isn't hidden */
    overflow: visible !important; 
}

.edit-element:hover {
    border: 1px dashed var(--primary-color);
}
