/* Sign PDF Tool Styles */

.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #374151;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-secondary:hover {
    background: rgba(79, 70, 229, 0.1);
    border-color: #4f46e5;
}

.signature-tabs {
    margin: 2rem 0;
    max-width: 100%;
}

.tabs-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.05);
}

.tab-btn.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

.tab-content {
    display: none;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
    display: block;
}

.signature-canvas-wrapper {
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: center;
}

#signature-canvas {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: crosshair;
    touch-action: none;
    background: #fff;
}

.signature-text-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-family: 'Brush Script MT', cursive;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    color: #000;
    transition: border-color 0.3s ease;
}

.signature-text-input:focus {
    outline: none;
    border-color: #6366f1;
}

.position-selector {
    text-align: center;
    margin: 2rem 0 1.5rem 0;
}

.position-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.position-select {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.position-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#upload-preview {
    text-align: center;
    margin-top: 1rem;
}

#upload-preview-img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

#text-signature-canvas {
    display: none;
}

.btn-secondary {
    cursor: pointer;
}

.hint-text {
    margin: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Light theme compatibility */
@media (prefers-color-scheme: light) {
    .btn-secondary {
        background: rgba(255, 255, 255, 0.8);
        border-color: #d1d5db;
        color: #1f2937;
    }
    .btn-secondary:hover {
        background: rgba(79, 70, 229, 0.1);
        border-color: #4f46e5;
    }
    .signature-canvas-wrapper {
        background: rgba(0, 0, 0, 0.02);
    }
    .signature-text-input {
        background: #fff;
        border-color: #d1d5db;
        color: #1f2937;
    }
    .position-select {
        background: rgba(255, 255, 255, 0.8);
        border-color: #d1d5db;
        color: #1f2937;
    }
    .position-label,
    .output-label {
        color: #1f2937;
    }
}

/* Mobile responsive */
@media (max-width: 640px) {
    .tabs-header {
        flex-direction: column;
        gap: 0;
    }

    .tab-btn {
        border-bottom: 1px solid var(--border-color);
        border-left: 3px solid transparent;
    }

    .tab-btn.active {
        border-left-color: #6366f1;
        border-bottom-color: var(--border-color);
    }

    #signature-canvas {
        width: 100%;
        max-width: 300px;
        height: 120px;
    }
}
