:root {
    --primary-color: #8b6f47;
    --primary-hover: #6d5637;
    --primary-light: #a68a64;
    --background: #faf8f5;
    --surface: #ffffff;
    --text-primary: #3e2723;
    --text-secondary: #8d6e63;
    --border: #e8dfd6;
    --shadow-sm: 0 1px 2px 0 rgb(62 39 35 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(62 39 35 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(62 39 35 / 0.1);
    --radius: 12px;
}

[data-theme="dark"] {
    --primary-color: #a68a64;
    --primary-hover: #8b6f47;
    --primary-light: #c4a57b;
    --background: #1a1512;
    --surface: #2d2520;
    --text-primary: #f5f1ed;
    --text-secondary: #bcaaa0;
    --border: #3e342d;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
}

/* Theme Switch Styles */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 20px;
    gap: 10px;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 70px;
    height: 34px;
    margin: 0;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #faf8f5, #f5f0e8);
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(139, 111, 71, 0.2);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 2px;
    background: linear-gradient(135deg, #8b6f47, #a68a64);
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(139, 111, 71, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.slider:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 8px;
    bottom: 7px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23faf8f5'%3E%3Cpath d='M12 2.25a.75.75 0 01.75.75v2.25a.75.75 0 01-1.5 0V3a.75.75 0 01.75-.75zM7.5 12a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM18.894 6.166a.75.75 0 00-1.06-1.06l-1.591 1.59a.75.75 0 101.06 1.061l1.591-1.59zM21.75 12a.75.75 0 01-.75.75h-2.25a.75.75 0 010-1.5H21a.75.75 0 01.75.75zM17.834 18.894a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 10-1.061 1.06l1.59 1.591zM12 18a.75.75 0 01.75.75V21a.75.75 0 01-1.5 0v-2.25A.75.75 0 0112 18zM7.758 17.303a.75.75 0 00-1.061-1.06l-1.591 1.59a.75.75 0 001.06 1.061l1.591-1.59zM6 12a.75.75 0 01-.75.75H3a.75.75 0 010-1.5h2.25A.75.75 0 016 12zM6.697 7.757a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 00-1.061 1.06l1.59 1.591z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: opacity 0.3s ease, left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    z-index: 3;
    pointer-events: none;
}

.slider .moon-icon {
    position: absolute;
    width: 16px;
    height: 16px;
    right: 7px;
    bottom: 7px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23faf8f5'%3E%3Cpath fill-rule='evenodd' d='M9.528 1.718a.75.75 0 01.162.819A8.97 8.97 0 009 6a9 9 0 009 9 8.97 8.97 0 003.463-.69.75.75 0 01.981.98 10.503 10.503 0 01-9.694 6.46c-5.799 0-10.5-4.701-10.5-10.5 0-4.368 2.667-8.112 6.46-9.694a.75.75 0 01.818.162z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: opacity 0.3s ease;
    opacity: 0;
    z-index: 3;
    pointer-events: none;
}

input:checked + .slider {
    background: linear-gradient(135deg, #2d2520, #1a1512);
    border-color: rgba(166, 138, 100, 0.4);
}

input:checked + .slider:before {
    transform: translateX(36px);
    background: linear-gradient(135deg, #c4a57b, #a68a64);
    box-shadow: 0 2px 8px rgba(196, 165, 123, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked + .slider:after {
    opacity: 0;
    left: 44px;
}

input:checked + .slider .moon-icon {
    opacity: 1;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.theme-switch-icon {
    display: none;
}

.theme-switch:hover .slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(139, 111, 71, 0.1);
    transform: scale(1.02);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    transition: all 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    box-sizing: border-box;
    flex: 1;
}

.navbar {
    display: flex;
    align-items: center;
    padding: 1rem 2.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.logo-text {
    font-family: "Bitcount Prop Double", sans-serif;
    font-size: 45px;
  
    
   font-weight: 350;
    
    letter-spacing: 3px;
}

.navbar-brand i {
    margin-right: 10px;
}

.navbar-links {
    display: flex;
    gap: 0.5rem;
}

.navbar-feature {
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
}

.navbar-feature:hover {
    color: var(--primary-color);
    background: var(--background);
}

.navbar-feature.active {
    color: var(--primary-color);
    background: var(--background);
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header i {
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: var(--border);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--background);
}

.file-list {
    list-style: none;
    padding: 0;
}

.file-item {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.file-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.file-name {
    font-weight: 500;
    display: flex;
    align-items: center;
}

.file-name i {
    margin-right: 10px;
    color: var(--primary-color);
}

.file-action {
    display: flex;
    align-items: center;
}

.drag-handle {
    cursor: move;
    margin-right: 10px;
    color: var(--border-color);
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: var(--card-shadow);
    animation: fadeIn 0.3s, fadeOut 0.5s 3.5s forwards;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.input-container {
    margin-bottom: 15px;
}

input[type="text"],
input[type="number"],
input[type="password"],
select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.05);
    background: var(--background);
}

input:hover,
select:hover {
    border-color: var(--primary-light);
}

/* Enhanced password input styling */
input[type="password"] {
    letter-spacing: 0.1em;
    font-family: 'Inter', monospace;
}

input[type="password"]:focus {
    letter-spacing: normal;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    cursor: pointer !important;
    background: var(--background);
    transition: all 0.3s;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    z-index: 1;
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: var(--surface);
    transform: scale(1.01);
}

.drop-zone.drop-zone-active,
.drop-zone.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.05), rgba(166, 138, 100, 0.05));
    border-style: solid;
}

.drop-zone-icon {
    font-size: 48px;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.drop-zone-prompt {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

footer {
    background: var(--surface);
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

footer p {
    margin: 0.25rem 0;
}

.steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-bottom: 20px;
}

.step {
    flex: 1;
    text-align: center;
    padding: 1.5rem;
    min-width: 200px;
}

.step h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0.75rem 0 0.5rem;
}

.step p {
    color: var(--text-secondary);
    font-size: 14px;
}

.step-icon {
    font-size: 36px;
    color: var(--primary-color);
    width: 72px;
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.1), rgba(166, 138, 100, 0.1));
    border-radius: 50%;
}

.success-icon {
    font-size: 72px;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.1), rgba(166, 138, 100, 0.1));
    border-radius: 50%;
}

#alert-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    z-index: 1000;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .drop-zone {
        padding: 20px;
    }
    
    .steps {
        flex-direction: column;
    }
    
    .step {
        margin-bottom: 20px;
    }
    
    .navbar {
        flex-direction: column;
        padding: 10px;
    }
    
    .navbar-brand {
        margin-bottom: 10px;
        margin-left: 0;
    }
    
    .navbar-links {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .navbar-feature {
        padding: 5px 10px;
        font-size: 14px;
    }
    
    .theme-switch-wrapper {
        margin: 10px 0 0 0;
    }
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* Split Method Options */
.split-method-options,
.compression-options,
.orientation-options,
.format-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.split-method,
.compression-option,
.orientation-option,
.format-option {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
}

.split-method:hover,
.compression-option:hover,
.orientation-option:hover,
.format-option:hover {
    border-color: var(--primary-color);
    background: var(--background);
}

.split-method.active,
.compression-option.active,
.orientation-option.active,
.format-option.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.1), rgba(166, 138, 100, 0.1));
    color: var(--primary-color);
}

/* Quality Slider */
.quality-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #e8dfd6 0%, var(--primary-color) 80%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 10px 0;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 10 !important;
    border: 2px solid var(--border);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quality-slider::-webkit-slider-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: linear-gradient(to right, #e8dfd6 0%, var(--primary-color) 80%);
    border-radius: 4px;
    border: none;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(139, 111, 71, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.quality-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: linear-gradient(to right, #e8dfd6 0%, var(--primary-color) 80%);
    border-radius: 4px;
    border: 2px solid var(--border);
}

.quality-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(139, 111, 71, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.quality-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Dark theme quality slider */
[data-theme="dark"] .quality-slider {
    background: linear-gradient(to right, #3e342d 0%, var(--primary-color) 80%);
    border-color: rgba(166, 138, 100, 0.3);
}

[data-theme="dark"] .quality-slider::-webkit-slider-track {
    background: linear-gradient(to right, #3e342d 0%, var(--primary-color) 80%);
}

[data-theme="dark"] .quality-slider::-moz-range-track {
    background: linear-gradient(to right, #3e342d 0%, var(--primary-color) 80%);
    border-color: rgba(166, 138, 100, 0.3);
}

/* PDF Page Selection Styles */
.page-selection-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 14px;
}

.selected-count {
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(139, 111, 71, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(139, 111, 71, 0.2);
}

.pdf-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    padding: 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--background);
    max-height: 400px;
    overflow-y: auto;
}

.pdf-page-item {
    position: relative;
    border: 3px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 3/4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pdf-page-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

.pdf-page-item.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.1), rgba(166, 138, 100, 0.1));
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.2);
}

.pdf-page-item canvas {
    width: 100%;
    height: auto;
    max-height: 80%;
    object-fit: contain;
}

.pdf-page-item .page-number {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(139, 111, 71, 0.9);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

.pdf-page-item .selection-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdf-page-item.selected .selection-indicator {
    opacity: 1;
}

.pdf-page-loading {
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
}

/* Dark theme styles for PDF page selection */
[data-theme="dark"] .selected-count {
    color: #c4a57b;
    background: rgba(166, 138, 100, 0.15);
    border-color: rgba(166, 138, 100, 0.3);
}

[data-theme="dark"] .pdf-pages-grid {
    border-color: rgba(166, 138, 100, 0.3);
    background: rgba(45, 37, 32, 0.5);
}

[data-theme="dark"] .pdf-page-item {
    border-color: rgba(166, 138, 100, 0.3);
    background: rgba(45, 37, 32, 0.8);
}

[data-theme="dark"] .pdf-page-item:hover {
    border-color: #a68a64;
}

[data-theme="dark"] .pdf-page-item.selected {
    border-color: #a68a64;
    background: linear-gradient(135deg, rgba(166, 138, 100, 0.15), rgba(196, 165, 123, 0.15));
    box-shadow: 0 4px 12px rgba(166, 138, 100, 0.3);
}

[data-theme="dark"] .pdf-page-item .page-number {
    background: rgba(166, 138, 100, 0.9);
}

[data-theme="dark"] .pdf-page-item .selection-indicator {
    background: #a68a64;
}

.quality-label {
    text-align: center;
    font-weight: 500;
    color: var(--primary-dark);
}

.feature-container {
    display: none;
}

.feature-container.active {
    display: block;
}

/* Image Preview Styles */
.image-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--background);
    min-height: 200px;
}

.image-preview-item {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    cursor: move;
    transition: all 0.3s ease;
    aspect-ratio: 3/4;
}

.image-preview-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

.image-preview-item.sortable-ghost {
    opacity: 0.5;
    transform: scale(0.95);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-preview-item .image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 0.5rem;
    font-size: 12px;
    text-align: center;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.image-preview-item .remove-image:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.image-preview-item .page-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(139, 111, 71, 0.9);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

/* Dark theme styles for image preview */
[data-theme="dark"] .image-preview-list {
    border-color: rgba(166, 138, 100, 0.3);
    background: rgba(45, 37, 32, 0.5);
}

[data-theme="dark"] .image-preview-item {
    border-color: rgba(166, 138, 100, 0.3);
    background: rgba(45, 37, 32, 0.8);
}

[data-theme="dark"] .image-preview-item:hover {
    border-color: #a68a64;
}

[data-theme="dark"] .image-preview-item .page-number {
    background: rgba(166, 138, 100, 0.9);
}
@media (max-width: 480px) {
    .navbar-links {
        flex-wrap: wrap;
        gap: 10px;
    }

    .navbar-feature {
        padding: 5px 10px;
        font-size: 14px;
    }
} 
/* Docs to PDF Styles */
.pdf-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
}

.setting-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.conversion-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    transition: all 0.2s ease;
}

.option-item:hover {
    border-color: var(--primary-color);
    background: var(--surface);
}

.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.option-item label {
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}

.margins-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.margin-input {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.margin-input label {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.margin-input input {
    width: 60px;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
}

.docs-preview-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--background);
    max-height: 300px;
    overflow-y: auto;
}

.docs-preview-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    transition: all 0.3s ease;
}

.docs-preview-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.docs-file-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.1), rgba(166, 138, 100, 0.1));
    border-radius: 8px;
    font-size: 24px;
    color: var(--primary-color);
}

.docs-file-info {
    flex: 1;
}

.docs-file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.docs-file-details {
    font-size: 12px;
    color: var(--text-secondary);
}

.docs-file-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-remove-doc {
    background: rgba(255, 0, 0, 0.1);
    color: #dc3545;
    border: 1px solid rgba(255, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove-doc:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: scale(1.05);
}

.supported-formats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.format-category {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
}

.format-category h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.format-category ul {
    list-style: none;
    padding: 0;
}

.format-category li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(139, 111, 71, 0.1);
}

.format-category li:last-child {
    border-bottom: none;
}

.format-category strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Dark theme styles for Docs to PDF */
[data-theme="dark"] .option-item {
    background: rgba(45, 37, 32, 0.5);
    border-color: rgba(166, 138, 100, 0.3);
}

[data-theme="dark"] .option-item:hover {
    border-color: #a68a64;
    background: rgba(45, 37, 32, 0.8);
}

[data-theme="dark"] .margin-input input {
    background: rgba(45, 37, 32, 0.8);
    border-color: rgba(166, 138, 100, 0.3);
    color: #f5f1ed;
}

[data-theme="dark"] .docs-preview-list {
    border-color: rgba(166, 138, 100, 0.3);
    background: rgba(45, 37, 32, 0.5);
}

[data-theme="dark"] .docs-preview-item {
    background: rgba(45, 37, 32, 0.8);
    border-color: rgba(166, 138, 100, 0.3);
}

[data-theme="dark"] .docs-preview-item:hover {
    border-color: #a68a64;
}

[data-theme="dark"] .docs-file-icon {
    background: linear-gradient(135deg, rgba(166, 138, 100, 0.15), rgba(196, 165, 123, 0.15));
}

[data-theme="dark"] .format-category {
    background: rgba(45, 37, 32, 0.5);
    border-color: rgba(166, 138, 100, 0.3);
}

[data-theme="dark"] .format-category li {
    border-bottom-color: rgba(166, 138, 100, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pdf-settings-grid {
        grid-template-columns: 1fr;
    }
    
    .conversion-options-grid {
        grid-template-columns: 1fr;
    }
    
    .margins-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .supported-formats {
        grid-template-columns: 1fr;
    }
}
/* PDF Security Styles */
.security-mode-options {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.security-mode {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
}

.security-mode:hover {
    border-color: var(--primary-color);
    background: var(--background);
}

.security-mode.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.1), rgba(166, 138, 100, 0.1));
    color: var(--primary-color);
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.password-toggle:hover {
    color: var(--primary-color);
    background: rgba(139, 111, 71, 0.1);
}

.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.strength-text {
    font-size: 12px;
    font-weight: 500;
}

.strength-text span {
    font-weight: 600;
}

.security-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    transition: all 0.3s ease;
}

.feature-item:hover {
    border-color: var(--primary-color);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.1), rgba(166, 138, 100, 0.1));
    border-radius: 12px;
    font-size: 24px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.feature-content h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Dark theme styles for PDF Security */
[data-theme="dark"] .security-mode {
    border-color: rgba(166, 138, 100, 0.3);
}

[data-theme="dark"] .security-mode:hover {
    border-color: #a68a64;
    background: rgba(45, 37, 32, 0.5);
}

[data-theme="dark"] .security-mode.active {
    border-color: #a68a64;
    background: linear-gradient(135deg, rgba(166, 138, 100, 0.15), rgba(196, 165, 123, 0.15));
    color: #c4a57b;
}

[data-theme="dark"] .password-toggle:hover {
    color: #a68a64;
    background: rgba(166, 138, 100, 0.15);
}

[data-theme="dark"] .strength-bar {
    background: rgba(166, 138, 100, 0.2);
}

[data-theme="dark"] .feature-item {
    background: rgba(45, 37, 32, 0.5);
    border-color: rgba(166, 138, 100, 0.3);
}

[data-theme="dark"] .feature-item:hover {
    border-color: #a68a64;
    background: rgba(45, 37, 32, 0.8);
}

[data-theme="dark"] .feature-icon {
    background: linear-gradient(135deg, rgba(166, 138, 100, 0.15), rgba(196, 165, 123, 0.15));
}

/* Responsive adjustments for PDF Security */
@media (max-width: 768px) {
    .security-features {
        gap: 1rem;
    }
    
    .feature-item {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .feature-icon {
        align-self: center;
    }
}
/* Enhanced Password Input Styling */
.password-input-container {
    margin-bottom: 1rem;
}

.password-input-container input {
    padding-right: 50px !important;
}

.password-toggle {
    right: 12px !important;
    padding: 8px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    z-index: 2 !important;
}

.password-toggle:hover {
    transform: scale(1.05) !important;
}

.password-toggle:active {
    transform: scale(0.95) !important;
}

.password-strength {
    margin-top: 0.75rem !important;
}

.strength-bar {
    height: 8px !important;
    border-radius: 4px !important;
    margin-bottom: 0.75rem !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(139, 111, 71, 0.1) !important;
}

.strength-fill {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
}

.strength-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    border-radius: 3px;
}

.strength-text {
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.strength-text span {
    transition: color 0.3s ease !important;
}

.strength-text::before {
    content: '🔒';
    font-size: 14px;
}

/* Dark theme password enhancements */
[data-theme="dark"] .strength-bar {
    border-color: rgba(166, 138, 100, 0.2) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}
/* Fix Password Toggle Button Positioning */
.password-toggle {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    padding: 6px !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    z-index: 10 !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    color: var(--text-secondary) !important;
}

.password-toggle:hover {
    transform: translateY(-50%) scale(1.05) !important;
    color: var(--primary-color) !important;
    background: rgba(139, 111, 71, 0.1) !important;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95) !important;
}

.password-toggle i {
    font-size: 14px !important;
    pointer-events: none !important;
}

.password-input-container {
    position: relative !important;
}

.password-input-container input {
    padding-right: 40px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
/* PDF Watermark Styles */
.watermark-type-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.watermark-type {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.watermark-type i {
    font-size: 1.5rem;
}

.watermark-type:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.watermark-type.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.watermark-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 200px;
    margin: 0 auto;
}

.position-option {
    aspect-ratio: 1;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-bg);
    font-size: 0.75rem;
    gap: 2px;
}

.position-option:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.position-option.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.watermark-image-preview {
    text-align: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
}

.watermark-features {
    display: grid;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .watermark-type-options {
        flex-direction: column;
    }
    
    .watermark-settings-grid {
        grid-template-columns: 1fr;
    }
    
    .position-grid {
        max-width: 150px;
    }
}
/* Watermark Preview Styles */
#watermark-preview-container {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--background);
    text-align: center;
}

#watermark-preview-canvas-container {
    position: relative;
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

#watermark-preview-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

#watermark-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.preview-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.watermark-preview-text {
    position: absolute;
    font-family: Arial, sans-serif;
    font-weight: bold;
    pointer-events: none;
    transform-origin: center;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.watermark-preview-image {
    position: absolute;
    pointer-events: none;
    transform-origin: center;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    #watermark-preview-canvas {
        max-width: 100%;
        width: 300px;
        height: 225px;
    }
    
    .preview-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
}
/* Enhanced Watermark Preview Styles */
#watermark-preview-overlay {
    overflow: hidden !important;
}

.watermark-preview-text {
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    transform-origin: center center !important;
}

.watermark-preview-image {
    object-fit: contain !important;
    z-index: 10 !important;
    transform-origin: center center !important;
}

#watermark-preview-canvas-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(0,0,0,0.02) 50%, transparent 51%);
    pointer-events: none;
    z-index: 1;
}

@media (max-width: 768px) {
    .watermark-preview-text {
        font-size: 0.8em !important;
    }
}
/* Perfect Watermark Options Styles */

/* Watermark Type Selection */
.watermark-type-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.watermark-type {
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface);
    position: relative;
    overflow: hidden;
}

.watermark-type::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 111, 71, 0.1), transparent);
    transition: left 0.5s ease;
}

.watermark-type:hover::before {
    left: 100%;
}

.watermark-type:hover {
    border-color: var(--primary-color);
    background: var(--background);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.watermark-type.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.watermark-type i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
    transition: transform 0.3s ease;
}

.watermark-type:hover i {
    transform: scale(1.1);
}

.watermark-type.active i {
    transform: scale(1.15);
}

/* Text Watermark Options */
#text-watermark-options {
    background: var(--background);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

#watermark-text {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

#watermark-text:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.1);
    background: white;
}

/* Settings Grid */
.watermark-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.setting-group {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.setting-group:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.setting-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-label::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Enhanced Form Controls */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.1);
    background: var(--surface);
}

.form-control:hover {
    border-color: var(--primary-light);
}

/* Color Input */
input[type="color"] {
    width: 100%;
    height: 45px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="color"]:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

/* Enhanced Range Sliders */
.form-range {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--border) 0%, var(--primary-color) 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
}

.form-range::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(139, 111, 71, 0.1));
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-range:hover::before {
    opacity: 1;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(139, 111, 71, 0.3), 0 0 0 1px rgba(139, 111, 71, 0.1);
    transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.4), 0 0 0 2px rgba(139, 111, 71, 0.2);
}

.form-range::-webkit-slider-thumb:active {
    transform: scale(1.25);
}

.form-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(139, 111, 71, 0.3);
    transition: all 0.2s ease;
}

.form-range::-moz-range-thumb:hover {
    transform: scale(1.15);
}

/* Position Grid */
.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 240px;
    margin: 0 auto;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.position-option {
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface);
    font-size: 0.8rem;
    gap: 2px;
    position: relative;
    overflow: hidden;
}

.position-option::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(139, 111, 71, 0.2), transparent);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.position-option:hover::before {
    width: 100%;
    height: 100%;
}

.position-option:hover {
    border-color: var(--primary-color);
    background: var(--background);
    transform: scale(1.05);
}

.position-option.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.position-option i {
    transition: transform 0.3s ease;
}

.position-option:hover i {
    transform: scale(1.1);
}

/* Image Watermark Options */
#image-watermark-options {
    background: var(--background);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

#watermark-image-upload {
    min-height: 140px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    background: var(--surface);
    transition: all 0.3s ease;
}

#watermark-image-upload:hover {
    border-color: var(--primary-color);
    background: var(--background);
    transform: scale(1.01);
}

#watermark-image-upload.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.05), rgba(166, 138, 100, 0.05));
    border-style: solid;
}

#image-preview-container {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.watermark-image-preview {
    text-align: center;
    padding: 1rem;
}

.watermark-image-preview img {
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.watermark-image-preview img:hover {
    transform: scale(1.02);
}

/* Page Selection */
#page-selection {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#page-selection:hover {
    border-color: var(--primary-color);
}

#page-selection:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.1);
}

#page-range-group {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

#page-range {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Preview Section Enhancements */
#watermark-preview-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

#watermark-preview-container {
    background: linear-gradient(135deg, var(--background), var(--surface));
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
}

#watermark-preview-container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light), var(--primary-color));
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#watermark-preview-container:hover::before {
    opacity: 0.1;
}

#watermark-preview-canvas-container {
    background: white;
    border: 3px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#watermark-preview-canvas-container:hover {
    transform: scale(1.01);
    box-shadow: 0 8px 25px rgba(139, 111, 71, 0.15);
}

.preview-controls {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

#update-preview-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

#update-preview-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#update-preview-btn:active {
    transform: translateY(0);
}

.preview-note {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.85rem;
    margin-left: 1rem;
}

/* Apply Button Enhancement */
#apply-watermark-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

#apply-watermark-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#apply-watermark-btn:hover::before {
    left: 100%;
}

#apply-watermark-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

#apply-watermark-btn:active {
    transform: translateY(-1px);
}

#apply-watermark-btn:disabled {
    background: var(--border);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

/* Dark Theme Adjustments */
[data-theme="dark"] .watermark-type {
    background: var(--surface);
    border-color: rgba(166, 138, 100, 0.3);
}

[data-theme="dark"] .watermark-type:hover {
    border-color: var(--primary-color);
    background: rgba(45, 37, 32, 0.8);
}

[data-theme="dark"] .watermark-type.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

[data-theme="dark"] .setting-group {
    background: rgba(45, 37, 32, 0.8);
    border-color: rgba(166, 138, 100, 0.3);
}

[data-theme="dark"] .form-control {
    background: rgba(45, 37, 32, 0.8);
    border-color: rgba(166, 138, 100, 0.3);
    color: var(--text-primary);
}

[data-theme="dark"] .position-option {
    background: rgba(45, 37, 32, 0.8);
    border-color: rgba(166, 138, 100, 0.3);
}

[data-theme="dark"] #watermark-preview-canvas-container {
    border-color: rgba(166, 138, 100, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .watermark-type-options {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .watermark-settings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .position-grid {
        max-width: 180px;
    }
    
    #watermark-preview-container {
        padding: 1rem;
    }
    
    .preview-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .watermark-type {
        padding: 1rem;
    }
    
    .watermark-type i {
        font-size: 1.5rem;
    }
    
    .setting-group {
        padding: 0.75rem;
    }
    
    .position-grid {
        max-width: 150px;
        gap: 0.25rem;
    }
}