/* Advanced PDF Editor Styles */
.tools-parent-container {


    .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 20px;
    }

    .header {
        text-align: center;
        margin-bottom: 30px;
        background-image: none;
        background-color: #1e1e1e;
        padding: 16px 5px;
    }

    .header-content h1 {
        color: white;
        font-size: 2.5rem;
        margin-bottom: 10px;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }

    .header-content p {
        color: rgba(255, 255, 255, 0.9);
        font-size: 1.1rem;
    }

    .main-content {
        background: white;
        border-radius: 20px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        width: 100%;
    }

    /* Upload Section */
    .upload-section {
        padding: 60px 40px;
        text-align: center;
    }

    .upload-area {
        border: 3px dashed #ddd;
        border-radius: 15px;
        padding: 60px 40px;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .upload-area:hover {
        border-color: #667eea;
        background: rgba(102, 126, 234, 0.05);
    }

    .upload-area.dragover {
        border-color: #667eea;
        background: rgba(102, 126, 234, 0.1);
        transform: scale(1.02);
    }

    .upload-icon {
        font-size: 4rem;
        color: #667eea;
        margin-bottom: 20px;
    }

    .upload-area h3 {
        font-size: 1.5rem;
        margin-bottom: 10px;
        color: #333;
    }

    .upload-area p {
        color: #666;
        margin-bottom: 30px;
    }

    /* Buttons */
    .btn {
        padding: 12px 24px;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .btn-primary {
        background-image: none;
        background-color: #1e1e1e;
        color: white;
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    }

    .btn-success {
        background: linear-gradient(135deg, #56ab2f, #a8e6cf);
        color: white;
    }

    .btn-success:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(86, 171, 47, 0.3);
    }

    .btn-secondary {
        background: #6c757d;
        color: white;
    }

    .btn-secondary:hover {
        background: #5a6268;
        transform: translateY(-1px);
    }

    .btn-danger {
        background: linear-gradient(135deg, #dc3545, #c82333);
        color: white;
    }

    .btn-danger:hover {
        background: linear-gradient(135deg, #c82333, #bd2130);
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
    }

    /* Editor Section */
    .editor-section {
        min-height: 80vh;
    }

    .editor-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 30px;
        background: #f8f9fa;
        border-bottom: 1px solid #e9ecef;
    }

    .file-tabs {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    .file-tab {
        padding: 10px 20px;
        background: white;
        border: 1px solid #ddd;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 8px;
        max-width: 200px;
    }

    .file-tab:hover {
        background: #f0f0f0;
    }

    .file-tab.active {
        background: #667eea;
        color: white;
        border-color: #667eea;
    }

    .file-tab-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .file-tab-close {
        background: none;
        border: none;
        color: inherit;
        cursor: pointer;
        padding: 2px;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .file-tab-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    /* Toolbar */
    .toolbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 30px;
        background: #fff;
        border-bottom: 1px solid #e9ecef;
        flex-wrap: wrap;
        gap: 15px;
    }

    .tool-group {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .tool-btn,
    .shape-btn {
        padding: 10px 15px;
        border: 1px solid #ddd;
        background: white;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 14px;
    }

    .tool-btn:hover,
    .shape-btn:hover {
        background: #f0f0f0;
    }

    .tool-btn.active,
    .shape-btn.active {
        background: #667eea;
        color: white;
        border-color: #667eea;
    }

    .shape-tools {
        display: flex;
        gap: 10px;
        padding: 10px;
        background: #f8f9fa;
        border-radius: 8px;
        margin: 0 15px;
    }

    #colorPicker,
    #fillColorPicker {
        width: 40px;
        height: 40px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
    }

    #sizeSlider {
        width: 100px;
    }

    #sizeDisplay {
        font-weight: 600;
        min-width: 40px;
    }

    /* Editor Workspace */
    .editor-workspace {
        padding: 30px;
        background: #f8f9fa;
        min-height: 60vh;
    }

    .pdf-container {
        background: white;
        border-radius: 10px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        overflow: auto;
        max-height: 70vh;
        padding: 20px;
    }

    .pdf-page {
        position: relative;
        margin: 20px auto;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        overflow: hidden;
        transition: box-shadow 0.3s ease;
        background: white;
        border: 1px solid #e9ecef;
    }

    .pdf-page:hover {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    }

    .pdf-canvas {
        display: block;
        max-width: 100%;
        height: auto;
        background: white;
    }

    .annotation-layer {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
    }

    .annotation {
        position: absolute;
        pointer-events: auto;
        cursor: move;
        border: 2px solid transparent;
        transition: all 0.3s ease;
    }

    .annotation:hover,
    .annotation.selected {
        border-color: #667eea;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    }

    /* Text Annotations */
    .text-annotation {
        background: rgba(255, 255, 255, 0.9);
        border-radius: 4px;
        min-width: 100px;
        min-height: 30px;
    }

    .text-display {
        padding: 8px;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        word-wrap: break-word;
        overflow: hidden;
    }

    /* Image Annotations */
    .image-annotation {
        border-radius: 4px;
        overflow: hidden;
    }

    .image-annotation img {
        pointer-events: none;
    }

    /* Shape Annotations */
    .shape-annotation {
        border-radius: 4px;
    }

    /* Drawing Annotations */
    .draw-annotation {
        pointer-events: auto;
    }

    .draw-controls {
        position: absolute;
        top: -35px;
        right: 0;
        background: white;
        border: 1px solid #ddd;
        border-radius: 6px;
        padding: 4px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 20;
    }

    /* Element Controls */
    .element-controls {
        position: absolute;
        top: -4px;
        left: 50%;
        transform: translateX(-50%);
        display: none;
        background: white;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 8px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        z-index: 20;
        white-space: nowrap;
    }

    .annotation:hover .element-controls,
    .annotation.selected .element-controls {
        display: flex;
        gap: 8px;
    }

    .control-btn {
        padding: 6px 10px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 12px;
        background: #f8f9fa;
        color: #333;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .control-btn:hover {
        background: #e9ecef;
        transform: translateY(-1px);
    }

    .control-btn.delete {
        background: #dc3545;
        color: white;
    }

    .control-btn.delete:hover {
        background: #c82333;
    }

    /* Resize Handles */
    .resize-handle {
        position: absolute;
        background: #667eea;
        border: 2px solid white;
        border-radius: 50%;
        width: 12px;
        height: 12px;
        display: none;
        z-index: 15;
        transition: all 0.2s ease;
    }

    .resize-handle:hover {
        background: #5a67d8;
        transform: scale(1.2);
    }

    .annotation:hover .resize-handle,
    .annotation.selected .resize-handle {
        display: block;
    }

    .resize-handle.nw {
        top: -6px;
        left: -6px;
        cursor: nw-resize;
    }

    .resize-handle.ne {
        top: -6px;
        right: -6px;
        cursor: ne-resize;
    }

    .resize-handle.sw {
        bottom: -6px;
        left: -6px;
        cursor: sw-resize;
    }

    .resize-handle.se {
        bottom: -6px;
        right: -6px;
        cursor: se-resize;
    }

    .resize-handle.n {
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        cursor: n-resize;
    }

    .resize-handle.s {
        bottom: -6px;
        left: 50%;
        transform: translateX(-50%);
        cursor: s-resize;
    }

    .resize-handle.w {
        top: 50%;
        left: -6px;
        transform: translateY(-50%);
        cursor: w-resize;
    }

    .resize-handle.e {
        top: 50%;
        right: -6px;
        transform: translateY(-50%);
        cursor: e-resize;
    }

    /* Modals */
    .text-input-modal,
    .image-modal,
    .shape-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        backdrop-filter: blur(8px);
        animation: modalFadeIn 0.3s ease-out;
    }

    @keyframes modalFadeIn {
        from {
            opacity: 0;
            backdrop-filter: blur(0px);
        }

        to {
            opacity: 1;
            backdrop-filter: blur(8px);
        }
    }

    .text-input-content,
    .image-modal-content,
    .shape-modal-content {
        background: white;
        padding: 30px;
        border-radius: 15px;
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
        max-width: 700px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        animation: modalSlideUp 0.3s ease-out;
    }

    @keyframes modalSlideUp {
        from {
            transform: translateY(50px);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .text-input-content h3,
    .image-modal-content h3,
    .shape-modal-content h3 {
        margin-bottom: 25px;
        color: #333;
        font-size: 1.4rem;
        display: flex;
        align-items: center;
        gap: 10px;
        border-bottom: 2px solid #f8f9fa;
        padding-bottom: 15px;
    }

    /* Text Formatting Toolbar */
    .text-formatting-toolbar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
        margin-bottom: 25px;
        padding: 25px;
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
        border-radius: 12px;
        border: 2px solid #e9ecef;
    }

    .formatting-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .formatting-group label {
        font-weight: 600;
        color: #495057;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .formatting-group label i {
        color: #667eea;
        width: 14px;
    }

    .font-select,
    .size-select {
        padding: 8px 12px;
        border: 2px solid #dee2e6;
        border-radius: 6px;
        font-size: 14px;
        background: white;
        min-width: 120px;
        transition: all 0.3s ease;
    }

    .font-select:focus,
    .size-select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    .style-buttons,
    .align-buttons {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }

    .style-btn,
    .align-btn {
        padding: 8px 12px;
        border: 2px solid #dee2e6;
        background: white;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-weight: 600;
        min-width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
    }

    .style-btn:hover,
    .align-btn:hover {
        background: #f8f9fa;
        border-color: #adb5bd;
        transform: translateY(-1px);
    }

    .style-btn.active,
    .align-btn.active {
        background: #667eea;
        color: white;
        border-color: #667eea;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

    .color-opacity-group {
        display: flex;
        align-items: center;
        gap: 15px;
        flex-wrap: wrap;
    }

    .color-input {
        width: 50px;
        height: 40px;
        border: 2px solid #dee2e6;
        border-radius: 6px;
        cursor: pointer;
        background: none;
        transition: all 0.3s ease;
    }

    .color-input:hover {
        border-color: #adb5bd;
        transform: scale(1.05);
    }

    .opacity-slider,
    .rotation-slider {
        flex: 1;
        height: 6px;
        border-radius: 3px;
        background: #e9ecef;
        outline: none;
        cursor: pointer;
        appearance: none;
        min-width: 100px;
    }

    .opacity-slider::-webkit-slider-thumb,
    .rotation-slider::-webkit-slider-thumb {
        appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #667eea;
        border: 2px solid white;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .opacity-slider::-webkit-slider-thumb:hover,
    .rotation-slider::-webkit-slider-thumb:hover {
        transform: scale(1.1);
        box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    }

    .opacity-display,
    .rotation-display {
        font-weight: 600;
        color: #495057;
        min-width: 45px;
        text-align: center;
        background: #f8f9fa;
        padding: 6px 10px;
        border-radius: 4px;
        border: 1px solid #dee2e6;
        font-size: 12px;
    }

    .rotation-controls {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .image-controls,
    .shape-controls {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-bottom: 25px;
    }

    .control-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .control-group label {
        font-weight: 600;
        color: #495057;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .control-group label i {
        color: #667eea;
        width: 14px;
    }

    .control-group input[type="range"] {
        width: 100%;
        height: 6px;
        border-radius: 3px;
        background: #e9ecef;
        outline: none;
        cursor: pointer;
        appearance: none;
    }

    .control-group input[type="range"]::-webkit-slider-thumb {
        appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #667eea;
        border: 2px solid white;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .control-group input[type="range"]::-webkit-slider-thumb:hover {
        transform: scale(1.1);
        box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    }

    .control-group input[type="color"] {
        width: 60px;
        height: 40px;
        border: 2px solid #dee2e6;
        border-radius: 6px;
        cursor: pointer;
        background: none;
        transition: all 0.3s ease;
    }

    .control-group input[type="color"]:hover {
        border-color: #adb5bd;
        transform: scale(1.05);
    }

    #strokeWidthDisplay,
    #imageOpacityDisplay,
    #imageRotationDisplay,
    #shapeOpacityDisplay,
    #shapeRotationDisplay {
        font-weight: 600;
        color: #495057;
        min-width: 45px;
        text-align: center;
        background: #f8f9fa;
        padding: 6px 10px;
        border-radius: 4px;
        border: 1px solid #dee2e6;
        font-size: 12px;
        margin-left: 10px;
    }

    /* Textarea */
    #textInput {
        width: 100%;
        height: 120px;
        padding: 15px;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        font-size: 14px;
        resize: vertical;
        font-family: inherit;
        line-height: 1.5;
        transition: all 0.3s ease;
        background: linear-gradient(135deg, #ffffff, #f8f9fa);
    }

    #textInput:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
        background: #ffffff;
    }

    #textInput::placeholder {
        color: #adb5bd;
        font-style: italic;
    }

    /* Modal Buttons */
    .text-input-buttons,
    .image-modal-buttons,
    .shape-modal-buttons {
        display: flex;
        gap: 12px;
        justify-content: flex-end;
        margin-top: 25px;
        padding-top: 20px;
        border-top: 2px solid #f8f9fa;
    }

    /* Tool Cursors */
    .tool-select {
        cursor: default;
    }

    .tool-text {
        cursor: text;
    }

    .tool-image {
        cursor: copy;
    }

    .tool-draw {
        cursor: crosshair;
    }

    .tool-shape {
        cursor: copy;
    }

    /* Loading Animation */
    .loading {
        display: inline-block;
        width: 18px;
        height: 18px;
        border: 3px solid rgba(255, 255, 255, .3);
        border-radius: 50%;
        border-top-color: #fff;
        animation: spin 1s ease-in-out infinite;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    /* Success and Error Messages */
    .success-message,
    .error-message {
        display: flex;
        align-items: center;
        gap: 12px;
        font-weight: 500;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        animation: slideInDown 0.4s ease-out;
        border-radius: 8px;
        padding: 15px 20px;
        margin: 15px 0;
        cursor: pointer;
    }

    .success-message {
        background: linear-gradient(135deg, #d4edda, #c3e6cb);
        color: #155724;
        border: 2px solid #b8dacc;
    }

    .error-message {
        background: linear-gradient(135deg, #f8d7da, #f5c6cb);
        color: #721c24;
        border: 2px solid #f1b0b7;
    }

    @keyframes slideInDown {
        from {
            transform: translateY(-30px);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .success-message i {
        color: #28a745;
        font-size: 1.1rem;
    }

    .error-message i {
        color: #dc3545;
        font-size: 1.1rem;
    }

    /* Button Disabled State */
    .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none !important;
    }

    /* Scrollbar Styling */
    ::-webkit-scrollbar {
        width: 10px;
    }

    ::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 5px;
    }

    ::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #667eea, #764ba2);
        border-radius: 5px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, #5a67d8, #6c5ce7);
    }

    /* Responsive Design */
    @media (max-width: 1200px) {
        .container {
            padding: 15px;
        }

        .text-formatting-toolbar {
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        }
    }

    @media (max-width: 768px) {

        .upload-section {
            padding: 40px 20px;
        }

        .upload-area {
            padding: 40px 20px;
        }

        .upload-icon {
            font-size: 3rem;
        }

        .editor-header {
            flex-direction: column;
            gap: 15px;
            align-items: stretch;
        }

        .toolbar {
            flex-direction: column;
            align-items: stretch;
            padding: 15px 20px;
        }

        .tool-group {
            justify-content: center;
            flex-wrap: wrap;
        }

        .shape-tools {
            justify-content: center;
            margin: 10px 0;
        }

        .editor-workspace {
            padding: 15px;
        }

        .file-tabs {
            justify-content: center;
        }

        .text-formatting-toolbar {
            grid-template-columns: 1fr;
            gap: 15px;
            padding: 20px;
        }

        .text-input-content,
        .image-modal-content,
        .shape-modal-content {
            padding: 20px;
            margin: 10px;
            border-radius: 12px;
        }

        .font-select,
        .size-select {
            min-width: 100%;
        }

        .resize-handle {
            width: 14px;
            height: 14px;
        }

        .element-controls {
            top: -45px;
            flex-wrap: wrap;
            max-width: 180px;
        }

        .control-btn {
            padding: 5px 8px;
            font-size: 11px;
        }

        .color-opacity-group {
            flex-direction: column;
            align-items: stretch;
            gap: 10px;
        }

        .rotation-controls {
            flex-direction: column;
            gap: 8px;
        }
    }

    @media (max-width: 480px) {

        .header-content p {
            font-size: 1rem;
        }

        .container {
            padding: 10px;
        }

        .upload-area {
            padding: 30px 15px;
        }

        .btn {
            padding: 10px 18px;
            font-size: 0.9rem;
        }

        .tool-btn,
        .shape-btn {
            padding: 8px 12px;
            font-size: 0.85rem;
        }

        .text-input-content,
        .image-modal-content,
        .shape-modal-content {
            padding: 15px;
            margin: 5px;
        }

        .text-input-content h3,
        .image-modal-content h3,
        .shape-modal-content h3 {
            font-size: 1.2rem;
        }

        .text-formatting-toolbar {
            padding: 15px;
            gap: 12px;
        }

        .style-btn,
        .align-btn {
            min-width: 32px;
            padding: 6px 8px;
            font-size: 12px;
        }

        .color-input {
            width: 45px;
            height: 35px;
        }

        .element-controls {
            position: static;
            transform: none;
            margin-bottom: 8px;
            justify-content: center;
        }

        .control-btn {
            padding: 6px 10px;
            font-size: 11px;
        }

        .text-input-buttons,
        .image-modal-buttons,
        .shape-modal-buttons {
            flex-direction: column;
            gap: 8px;
        }

        .btn {
            width: 100%;
            justify-content: center;
        }

        .file-tab {
            max-width: 140px;
            padding: 8px 12px;
        }

        .pdf-container {
            max-height: 60vh;
        }

        .editor-workspace {
            padding: 10px;
        }

        #textInput {
            height: 100px;
            padding: 12px;
            font-size: 13px;
        }
    }

    @media (max-width: 320px) {


        .upload-area {
            padding: 20px 10px;
        }

        .upload-icon {
            font-size: 2.5rem;
        }

        .text-input-content,
        .image-modal-content,
        .shape-modal-content {
            padding: 12px;
        }

        .text-formatting-toolbar {
            padding: 12px;
        }

        .style-btn,
        .align-btn {
            min-width: 28px;
            padding: 4px 6px;
            font-size: 11px;
        }

        .control-btn {
            padding: 4px 8px;
            font-size: 10px;
        }
    }

    /* Print Styles */
    @media print {

        .header,
        .toolbar,
        .editor-header,
        .element-controls,
        .resize-handle,
        .text-input-modal,
        .image-modal,
        .shape-modal {
            display: none !important;
        }

        .main-content {
            box-shadow: none;
            border-radius: 0;
        }

        .pdf-page {
            box-shadow: none;
            margin: 0;
            page-break-inside: avoid;
        }

        .annotation {
            border: none !important;
            box-shadow: none !important;
        }
    }

    /* High Contrast Mode Support */
    @media (prefers-contrast: high) {
        .annotation {
            border-width: 3px;
        }

        .btn {
            border: 2px solid currentColor;
        }

        .text-input-modal,
        .image-modal,
        .shape-modal {
            background: rgba(0, 0, 0, 0.9);
        }
    }

    /* Reduced Motion Support */
    @media (prefers-reduced-motion: reduce) {

        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }

    /* Selection Styles */
    ::selection {
        background: rgba(102, 126, 234, 0.3);
        color: inherit;
    }

    ::-moz-selection {
        background: rgba(102, 126, 234, 0.3);
        color: inherit;
    }

    /* Focus Styles for Accessibility */
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid rgba(102, 126, 234, 0.3);
        outline-offset: 2px;
    }

    /* Utility Classes */
    .visually-hidden {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    /* Backdrop Filter Fallback */
    @supports not (backdrop-filter: blur(8px)) {

        .text-input-modal,
        .image-modal,
        .shape-modal {
            background: rgba(0, 0, 0, 0.8);
        }
    }


    @supports not (display: grid) {
        .text-formatting-toolbar {
            display: flex;
            flex-wrap: wrap;
        }

        .formatting-group {
            flex: 1;
            min-width: 220px;
        }
    }

    .draw-delete-btn {
        position: absolute;
        top: 5px;
        right: 5px;
        background: #dc3545;
        color: white;
        border: none;
        border-radius: 50%;
        width: 25px;
        height: 25px;
        cursor: pointer;
        font-size: 12px;
        display: none;
        z-index: 1000;
        transition: all 0.2s ease;
    }

    .draw-delete-btn:hover {
        background: #c82333;
        transform: scale(1.1);
    }

    .draw-annotation.selected+.draw-delete-btn {
        display: block;
    }
}