/**
 * SwiftSign End-to-End Confirmation Styles
 * GitHub Issue #292 - eDocs/eSign: End to End Confirmation
 */

/* In-progress states - RED background, white font */
.swiftsign-encrypting,
.swiftsign-sending,
.swiftsign-awaiting {
    background-color: #d32f2f !important;
    color: #ffffff !important;
    border-color: #b71c1c !important;
}

.swiftsign-encrypting:hover,
.swiftsign-sending:hover,
.swiftsign-awaiting:hover {
    background-color: #b71c1c !important;
    color: #ffffff !important;
}

/* Warning states - ORANGE/YELLOW background */
.swiftsign-warning,
.swiftsign-error {
    background-color: #ff9800 !important;
    color: #ffffff !important;
    border-color: #f57c00 !important;
}

.swiftsign-warning:hover,
.swiftsign-error:hover {
    background-color: #f57c00 !important;
    color: #ffffff !important;
}

/* Error state - clickable for retry */
.swiftsign-error {
    cursor: pointer !important;
    transition: all 0.3s ease;
}

.swiftsign-error:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Success state - BLUE background (current style) */
.swiftsign-success {
    background-color: #2196f3 !important;
    color: #ffffff !important;
    border-color: #1976d2 !important;
}

.swiftsign-success:hover {
    background-color: #1976d2 !important;
    color: #ffffff !important;
}

/* Spinner animation speeds */
.fast-spin-4x {
    animation: fa-spin 0.25s infinite linear !important;
}

.fast-spin-2x {
    animation: fa-spin 0.5s infinite linear !important;
}

.fast-spin-1x {
    animation: fa-spin 1s infinite linear !important;
}

/* Icon positioning */
.swiftsign-encrypting i:first-child,
.swiftsign-sending i:first-child,
.swiftsign-awaiting i:first-child {
    margin-right: 8px;
}

.swiftsign-success i:first-child,
.swiftsign-success i:last-child {
    margin: 0 4px;
}

.swiftsign-error i:last-child {
    margin-left: 8px;
}

/* Disable pointer events when button is disabled */
#swift_sign_submit[disabled]:not(.swiftsign-error) {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.9;
}

/* Pulse animation for warning state */
.swiftsign-warning {
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0);
    }
}

/* Success animation */
.swiftsign-success {
    animation: pulse-success 1.5s 1;
}

@keyframes pulse-success {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #swift_sign_submit {
        font-size: 14px;
        padding: 10px 20px;
    }

    .swiftsign-encrypting i,
    .swiftsign-sending i,
    .swiftsign-awaiting i {
        font-size: 1.2em;
    }
}

/* Print button - ensure it doesn't get affected */
#swift_print_submit {
    /* Preserve original styles */
}
