@charset "UTF-8";

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--font-color);
    padding-top: 30px;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
}

.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--font-color);
}

.tool-header p {
    font-size: 1.1em;
    color: var(--font-color);
    margin: 0;
    opacity: 0.8;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #4CAF50;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--content-bg-color);
}

.upload-area:hover {
    border-color: #45a049;
    background-color: rgba(76, 175, 80, 0.1);
}

.upload-area.dragover {
    border-color: #45a049;
    background-color: rgba(76, 175, 80, 0.2);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.upload-area h3 {
    margin: 0 0 10px 0;
    color: var(--font-color);
}

.upload-area p {
    margin: 0;
    color: var(--font-color);
    opacity: 0.7;
}

/* Signature Section */
.signature-section {
    display: none;
    margin-bottom: 30px;
    background-color: var(--content-bg-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
    color: var(--font-color);
}

.signature-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.signature-tab {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--font-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.signature-tab.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.signature-tab:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

.signature-tab.active:hover {
    background-color: #45a049;
}

.signature-content {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 20px;
    background-color: var(--bg-color);
}

.signature-panel {
    display: none;
}

.signature-panel.active {
    display: block;
}

#resetBtn {
    font-size: 20px;
}

/* Draw Panel */
#drawPanel {
    text-align: center;
}

#signatureCanvas {
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background-color: transparent;
    cursor: crosshair;
    margin-bottom: 15px;
    /* Fixed checkerboard pattern that stays consistent in dark/light mode */
    background-color: white;
    background-size: 16px 16px;
    background-position: 0 0, 0 0, 8px 8px, 8px 8px;
}

.canvas-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.color-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--content-bg-color);
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-container label {
    color: var(--font-color);
    font-weight: 500;
    white-space: nowrap;
}

.color-picker {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.color-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-preset {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-preset:hover {
    transform: scale(1.1);
    border-color: #4CAF50;
}

.color-preset.active {
    border-color: #4CAF50;
    border-width: 3px;
}

/* Type Panel */
#typePanel {
    text-align: center;
}

.typed-signature-input {
    width: 100%;
    max-width: 400px;
    padding: 15px;
    font-size: 24px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--content-bg-color);
    color: var(--font-color);
    margin-bottom: 15px;
    text-align: center;
}

.font-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.font-option {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--font-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.font-option.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.typed-signature-preview {
    min-height: 100px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 36px;
}

/* Upload Panel */
#uploadPanel {
    text-align: center;
}

.signature-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 5px;
    padding: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.signature-upload-area:hover {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

.signature-upload-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* PDF Preview Section */
.preview-section {
    display: none;
    margin-bottom: 30px;
}

.export-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 20px;
    background-color: var(--content-bg-color);
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.export-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.export-group label {
    font-weight: bold;
    color: var(--font-color);
}

.select-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--bg-color);
    color: var(--font-color);
    font-size: 14px;
}

.preview-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}

.page-preview {
    background-color: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.page-canvas-container {
    position: relative;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.page-canvas {
    width: 100%;
    height: auto;
    display: block;
}

.signature-overlay {
    position: absolute;
    cursor: move;
    border: 2px dashed transparent;
    user-select: none;
    z-index: 10;
}

.signature-overlay:hover {
    border-color: #4CAF50;
}

.signature-overlay.selected {
    border-color: #4CAF50;
}

.signature-overlay img {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.signature-resize-handle {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    background-color: #4CAF50;
    border: 1px solid white;
    border-radius: 50%;
    cursor: nw-resize;
    display: none;
}

.signature-overlay:hover .signature-resize-handle,
.signature-overlay.selected .signature-resize-handle {
    display: block;
}

.page-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.page-title {
    font-weight: bold;
    color: var(--font-color);
}

.page-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Buttons */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: var(--content-bg-color);
    color: var(--font-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

/* Progress Modal */
.progress-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.progress-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--content-bg-color);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    min-width: 300px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: var(--font-color);
    margin-bottom: 10px;
}

/* Status Messages */
.status-messages {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.status-message {
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    opacity: 0;
    animation: slideIn 0.3s ease forwards;
}

.status-message.success {
    background-color: #28a745;
}

.status-message.error {
    background-color: #dc3545;
}

.status-message.info {
    background-color: #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Add these styles to the signature overlay section */
.signature-overlay .signature-delete-btn {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 20px;
    height: 20px;
    background-color: #dc3545;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 15;
}

.signature-overlay:hover .signature-delete-btn,
.signature-overlay.selected .signature-delete-btn {
    display: flex;
}

.signature-delete-btn:hover {
    background-color: #c82333;
}

/* Add reset button styles */
.reset-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }
    
    .signature-tabs {
        flex-direction: column;
    }
    
    .font-options {
        justify-content: stretch;
    }
    
    .font-option {
        flex: 1;
        min-width: auto;
    }
    
    .color-presets {
        justify-content: center;
    }
    
    .page-preview {
        max-width: 100%;
    }
}