/**
 * Public-facing CSS for the Digital Signatures for WooCommerce plugin.
 *
 * @since      1.0.0
 */

/* Signature Container */
.dsfwc-signature-container {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.dsfwc-signature-container h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Document Content */
.dsfwc-document-content {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1.6;
}

.dsfwc-document-content h2 {
    margin-top: 0;
    font-size: 24px;
    border-bottom: none;
    padding-bottom: 0;
}

/* Signature Pad */
.dsfwc-signature-pad-container {
    margin-bottom: 20px;
}

.dsfwc-signature-pad-header {
    margin-bottom: 10px;
}

.dsfwc-signature-pad-header p {
    font-weight: bold;
    color: #333;
}

.dsfwc-signature-pad-body {
    position: relative;
    width: 100%;
    height: 200px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #fff;
    cursor: crosshair; /* Show crosshair cursor to indicate drawing area */
    touch-action: none; /* Fix for touch devices */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dsfwc-signature-pad-body.signed {
    padding: 10px;
    height: auto;
    cursor: default;
}

.dsfwc-signature-pad-body.signed img {
    max-width: 100%;
    height: auto;
}

/* This is important! Canvas must be position:absolute and cover the entire container */
.signature-pad {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.dsfwc-signature-pad-footer {
    margin-top: 10px;
    text-align: right;
}

.dsfwc-signature-pad-footer button {
    margin-left: 10px;
}

/* Signature guidance */
.dsfwc-signature-pad-container:before {
    content: '';
    position: absolute;
    bottom: 30px;
    left: 20px;
    right: 20px;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 0;
    pointer-events: none;
}

/* Signature Pad Status Messages */
.dsfwc-signature-error {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

.dsfwc-success-message {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    font-weight: 500;
}

.dsfwc-legal-notice {
    margin-top: 20px;
    font-size: 12px;
    color: #777;
    font-style: italic;
}

/* Signature Status */
.dsfwc-status {
    display: inline-block;
    padding: 3px 5px;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1;
    color: #fff;
    text-transform: uppercase;
}

.dsfwc-status-signed {
    background: #5cb85c;
}

.dsfwc-status-pending {
    background: #f0ad4e;
}

/* Download Button Styles */
.woocommerce-button.button.download,
.button.download {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 5px;
}

.woocommerce-button.button.download:hover,
.button.download:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: #fff;
}

.woocommerce-button.button.download:before,
.button.download:before {
    content: "\f346";
    font-family: dashicons;
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

/* Download button in signature view */
.dsfwc-signature-container .button-primary.download {
    background-color: #007cba;
    border-color: #007cba;
}

.dsfwc-signature-container .button-primary.download:hover {
    background-color: #005a87;
    border-color: #005a87;
}

/* Action Buttons Container */
.dsfwc-action-buttons {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    align-items: center;
    flex-wrap: wrap;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
}

/* Shared Button Styling */
.button.dsfwc-back-to-signatures,
.button.dsfwc-download-button,
.button.dsfwc-clear-button,
.button.dsfwc-sign-button {
    background-color: #4d6dd9 !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    font-family: 'overusedgrotesk-semibold', sans-serif !important;
    border: none !important;
    padding: 12px 24px !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: background-color 0.3s ease !important;
    cursor: pointer !important;
}

.button.dsfwc-back-to-signatures:hover,
.button.dsfwc-back-to-signatures:focus,
.button.dsfwc-back-to-signatures:active,
.button.dsfwc-download-button:hover,
.button.dsfwc-download-button:focus,
.button.dsfwc-download-button:active,
.button.dsfwc-clear-button:hover,
.button.dsfwc-clear-button:focus,
.button.dsfwc-clear-button:active,
.button.dsfwc-sign-button:hover,
.button.dsfwc-sign-button:focus,
.button.dsfwc-sign-button:active {
    background-color: #3d5bc7 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .dsfwc-signature-pad-body {
        height: 150px;
    }
    
    .dsfwc-document-content {
        padding: 15px;
    }
    
    .woocommerce-orders-table .woocommerce-button.button {
        margin-bottom: 5px;
        display: block;
        width: 100%;
        text-align: center;
    }
    
    .woocommerce-button.button.download {
        margin-left: 0;
        margin-top: 5px;
    }
    
    /* Stack action buttons on mobile */
    .dsfwc-action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .button.dsfwc-back-to-signatures,
    .button.dsfwc-download-button {
        width: 100%;
        text-align: center;
    }
    
    /* Signature pad buttons responsive styling */
    .dsfwc-signature-pad-footer {
        text-align: center;
    }
    
    .button.dsfwc-clear-button,
    .button.dsfwc-sign-button {
        width: 48%;
        margin: 0 1%;
    }
} 