/* ============================================
   🖋️ INK DECLARATION SECTION - Enhanced
   ============================================ */

/* Main Ink Section */
.ink-section {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 200, 100, 0.1));
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 2rem 1rem;
    margin: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ink-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 136, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.ink-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.ink-title {
    color: #00ff88;
    font-size: 1.8rem;
    margin: 0 0 1rem 0;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.ink-subtitle {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 2rem 0;
    color: #e0e0e0;
    opacity: 0.9;
}

/* Enhanced Canvas Container */
.signing-canvas-container {
    margin: 2rem 0;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.signing-canvas-container.hidden {
    display: none;
}

.canvas-instructions {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 255, 136, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.canvas-instructions p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.canvas-instructions strong {
    color: #00ff88;
}

.family-friendly-reminder {
    color: #ffd700;
    font-style: italic;
    font-size: 0.85rem;
}

/* Enhanced Canvas Styling */
.canvas-wrapper {
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
}

#signature-canvas {
    border: 3px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    background: linear-gradient(145deg, #fafafa, #f0f0f0);
    cursor: crosshair;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

#signature-canvas:hover {
    border-color: rgba(0, 255, 136, 0.5);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.15),
        0 0 0 4px rgba(0, 255, 136, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#signature-canvas.drawing {
    border-color: rgba(0, 255, 136, 0.8);
    box-shadow: 
        0 0 30px rgba(0, 255, 136, 0.3),
        0 0 0 4px rgba(0, 255, 136, 0.2);
    transform: scale(1.02);
}

.canvas-hint {
    font-size: 0.8rem;
    color: #ccc;
    margin-top: 0.8rem;
    font-style: italic;
    opacity: 0.8;
}

/* Button Actions */
.canvas-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.canvas-actions .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #00ff88, #00cc66);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00cc66, #00aa55);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Signature Certificate */
.saved-signature-display {
    margin: 2rem 0;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.saved-signature-display.hidden {
    display: none;
}

.signature-certificate {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.1);
}

.signature-certificate h3 {
    color: #ffd700;
    margin: 0 0 1rem 0;
    font-size: 1.4rem;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.signature-preview {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

#signature-preview-canvas {
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    max-width: 100%;
    height: auto;
}

.certificate-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Main Ink Button */
.ink-actions {
    margin-top: 2rem;
}

.sparkle-button {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    position: relative;
}

/* Enhanced Mobile-First Button */
.sparkle-button button {
    width: 100%;
    background: linear-gradient(135deg, #00ff88, #00cc66);
    color: #000;
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 60px;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
    position: relative;
    overflow: hidden;
}

.sparkle-button button::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.sparkle-button button:hover::before {
    transform: translateX(100%);
}

.sparkle-button button:hover,
.sparkle-button button:focus {
    background: linear-gradient(135deg, #00cc66, #00aa55);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.4);
}

.sparkle-button .text {
    color: #000;
    font-weight: bold;
    z-index: 1;
    position: relative;
}

/* Alternative Link */
.ink-alternative {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #ccc;
    opacity: 0.8;
}

.link-styled {
    color: #00ff88;
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-styled:hover {
    color: #00cc66;
    text-decoration: underline;
}

/* Responsive Design */
@media (min-width: 768px) {
    .ink-section {
        padding: 3rem 2rem;
    }

    .ink-title {
        font-size: 2.2rem;
    }

    .ink-subtitle {
        font-size: 1.1rem;
    }

    .canvas-actions {
        flex-direction: row;
        justify-content: center;
        gap: 1.5rem;
    }

    .canvas-actions .btn {
        flex: 0 0 auto;
        min-width: 140px;
    }

    .certificate-actions {
        flex-direction: row;
        justify-content: center;
        gap: 1.5rem;
    }

    .sparkle-button {
        max-width: 350px;
    }

    .signing-canvas-container {
        padding: 2.5rem 2rem;
    }

    /* Re-enable sparkle effects on larger screens */
    .sparkle-button .spark,
    .sparkle-button .backdrop,
    .sparkle-button .particle-pen,
    .sparkle-button .sparkle {
        display: block;
    }
}

@media (min-width: 1024px) {
    .ink-title {
        font-size: 2.5rem;
    }

    .ink-subtitle {
        font-size: 1.2rem;
    }

    .canvas-actions .btn,
    .certificate-actions .btn {
        padding: 1rem 2rem;
        min-width: 160px;
    }

    .sparkle-button button {
        padding: 1.5rem 2.5rem;
        font-size: 1.2rem;
    }
}

/* Success States */
.ink-section.success {
    border-color: rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
}

.ink-section.success::before {
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
}
