/**
 * CCM NDA Generator - Frontend Styles
 * Matches the clean theme of other CCM Resource Tools
 *
 * @package CCMResourceTools
 * @version 1.0.0
 */

/* NDA Generator Container */
.resource-tools-nda {
    margin: 2rem 0;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

/* Ensure wrapper has proper stacking context */
.ccm-resource-tools-wrapper.resource-tools-nda {
    position: relative;
    z-index: 10;
    background: transparent;
}

/* Form Section Styling */
.resource-tools-nda .ccm-form-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
}

.resource-tools-nda .ccm-section-title {
    color: #212529;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.resource-tools-nda .ccm-section-icon {
    font-size: 1rem;
}

/* Input Styling */
.resource-tools-nda .ccm-nda-input {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.resource-tools-nda .ccm-nda-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    outline: none;
}

.resource-tools-nda .ccm-nda-input::placeholder {
    color: #adb5bd;
}

.resource-tools-nda .ccm-nda-input.is-invalid {
    border-color: #dc3545;
}

.resource-tools-nda .ccm-nda-input.is-valid {
    border-color: #198754;
}

/* Checkbox Styling */
.resource-tools-nda .ccm-checkbox-item {
    padding: 0.625rem 0.875rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    height: 100%;
}

.resource-tools-nda .ccm-checkbox-item:hover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.02);
}

/* Checkbox grid with proper gaps */
.resource-tools-nda .ccm-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 767px) {
    .resource-tools-nda .ccm-checkbox-grid {
        grid-template-columns: 1fr;
    }
}

.resource-tools-nda .form-check-input {
    width: 1.15em;
    height: 1.15em;
    margin-top: 0.15em;
    border: 1px solid #dee2e6;
    cursor: pointer;
    background-color: white;
}

.resource-tools-nda .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.resource-tools-nda .form-check-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.resource-tools-nda .form-check-label {
    cursor: pointer;
    color: #212529;
    user-select: none;
}

/* NDA Output Container */
.ccm-nda-output {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* NDA Content Formatting */
.ccm-nda-output .nda-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #dee2e6;
}

.ccm-nda-output .nda-header h1 {
    color: #212529;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ccm-nda-output .nda-meta {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Schedule Table Styling */
.ccm-nda-output .schedule-section {
    margin-bottom: 2rem;
}

.ccm-nda-output .schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.ccm-nda-output .schedule-table tr {
    border-bottom: 1px solid #dee2e6;
}

.ccm-nda-output .schedule-table tr:last-child {
    border-bottom: none;
}

.ccm-nda-output .schedule-table td {
    padding: 1rem 0.75rem;
    vertical-align: top;
}

.ccm-nda-output .schedule-table .term-cell {
    width: 180px;
    background: #f8f9fa;
    font-weight: 500;
}

.ccm-nda-output .schedule-table .meaning-cell {
    padding-left: 1.5rem;
}

.ccm-nda-output .schedule-table .meaning-cell p {
    margin-bottom: 0.5rem;
}

.ccm-nda-output .schedule-table .meaning-cell p:last-child {
    margin-bottom: 0;
}

/* Clause item indentation */
.ccm-nda-output .clause-item {
    padding-left: 2rem;
    text-indent: -0.5rem;
}

/* Execution section styling */
.ccm-nda-output .execution-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.ccm-nda-output .execution-note {
    color: #6c757d;
    font-style: italic;
}

/* Agreement intro styling */
.ccm-nda-output .agreement-intro {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
    margin: 2rem 0;
}

.ccm-nda-output .nda-section {
    margin-bottom: 1.5rem;
}

.ccm-nda-output .nda-section:last-child {
    margin-bottom: 0;
}

.ccm-nda-output h2 {
    color: #212529;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.ccm-nda-output h2:first-child {
    margin-top: 0;
}

.ccm-nda-output h3 {
    color: #212529;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.ccm-nda-output p {
    margin-bottom: 0.75rem;
    color: #212529;
}

.ccm-nda-output ul,
.ccm-nda-output ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.ccm-nda-output li {
    margin-bottom: 0.35rem;
    color: #212529;
}

.ccm-nda-output strong {
    color: #212529;
    font-weight: 600;
}

.ccm-nda-output a {
    color: #0d6efd;
    text-decoration: none;
}

.ccm-nda-output a:hover {
    text-decoration: underline;
}

/* Party Details Box */
.ccm-nda-output .party-details {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.ccm-nda-output .party-details p {
    margin-bottom: 0.25rem;
}

.ccm-nda-output .party-details p:last-child {
    margin-bottom: 0;
}

/* Signature Section */
.ccm-signature-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.ccm-signature-block {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.ccm-signature-pad-container {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.ccm-signature-pad {
    width: 100%;
    height: 150px;
    cursor: crosshair;
    touch-action: none;
}

.ccm-signature-pad-container .ccm-clear-signature {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

/* Signature Line for PDF */
.ccm-nda-output .signature-line {
    border-top: 1px solid #212529;
    margin-top: 3rem;
    padding-top: 0.5rem;
    display: inline-block;
    min-width: 200px;
}

/* Scrollbar Styling */
.ccm-nda-output::-webkit-scrollbar {
    width: 8px;
}

.ccm-nda-output::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.ccm-nda-output::-webkit-scrollbar-thumb {
    background: rgba(13, 110, 253, 0.3);
    border-radius: 4px;
}

.ccm-nda-output::-webkit-scrollbar-thumb:hover {
    background: rgba(13, 110, 253, 0.5);
}

/* Stat Boxes */
.resource-tools-nda .ccm-stat-box {
    border: 1px solid #dee2e6;
    background-color: white !important;
    transition: all 0.2s ease;
}

.resource-tools-nda .ccm-stat-box:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.resource-tools-nda .ccm-stat-box small {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
}

.resource-tools-nda .ccm-stat-box strong {
    font-size: 1.1rem;
    color: #0d6efd;
}

/* Copy Button Styling */
.resource-tools-nda .ccm-copy-nda-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.resource-tools-nda .ccm-copy-nda-btn:hover {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.resource-tools-nda .ccm-copy-nda-btn:hover svg {
    stroke: white;
}

.resource-tools-nda .ccm-copy-nda-btn.copy-success {
    background-color: #198754;
    color: white;
    border-color: #198754;
}

/* CCM Button Styling - Match clickclickmedia.com.au */
.resource-tools-nda .btn.btn-primary,
.resource-tools-nda .btn-primary {
    color: #fff;
    background-size: 100%;
    background-image: -webkit-gradient(linear, left top, right top, from(#1a5ddf), to(#2580a7));
    background-image: linear-gradient(to right, #1a5ddf, #2580a7);
    border: none;
    position: relative;
    z-index: 100;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(26, 93, 223, 0.2);
}

.resource-tools-nda .btn.btn-primary:hover,
.resource-tools-nda .btn-primary:hover {
    background-image: linear-gradient(to right, #1550c9, #1f6d91);
    box-shadow: 0 4px 8px rgba(26, 93, 223, 0.3);
    transform: translateY(-1px);
    color: #fff;
}

.resource-tools-nda .btn.btn-primary:active,
.resource-tools-nda .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(26, 93, 223, 0.2);
}

.resource-tools-nda .btn.btn-primary:disabled,
.resource-tools-nda .btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.resource-tools-nda .btn.btn-secondary,
.resource-tools-nda .btn-secondary {
    color: #fff;
    background-size: 100%;
    background-image: -webkit-gradient(linear, left top, right top, from(#1a5ddf), to(#2580a7));
    background-image: linear-gradient(to right, #1a5ddf, #2580a7);
    border: none;
    position: relative;
    z-index: 100;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(26, 93, 223, 0.2);
}

.resource-tools-nda .btn.btn-secondary:hover,
.resource-tools-nda .btn-secondary:hover {
    background-image: linear-gradient(to right, #1550c9, #1f6d91);
    box-shadow: 0 4px 8px rgba(26, 93, 223, 0.3);
    transform: translateY(-1px);
    color: #fff;
}

.resource-tools-nda .btn.btn-secondary:active,
.resource-tools-nda .btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(26, 93, 223, 0.2);
}

/* Outline buttons with CCM gradient on hover */
.resource-tools-nda .btn.btn-outline-primary,
.resource-tools-nda .btn-outline-primary {
    color: #1a5ddf;
    background: transparent;
    border: 2px solid #1a5ddf;
    padding: 0.45rem 1.2rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.resource-tools-nda .btn.btn-outline-primary:hover,
.resource-tools-nda .btn-outline-primary:hover {
    color: #fff;
    background-image: linear-gradient(to right, #1a5ddf, #2580a7);
    border-color: transparent;
    box-shadow: 0 4px 8px rgba(26, 93, 223, 0.3);
    transform: translateY(-1px);
}

.resource-tools-nda .btn.btn-outline-secondary,
.resource-tools-nda .btn-outline-secondary {
    color: #1a5ddf;
    background: transparent;
    border: 2px solid #dee2e6;
    padding: 0.45rem 1.2rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.resource-tools-nda .btn.btn-outline-secondary:hover,
.resource-tools-nda .btn-outline-secondary:hover {
    color: #fff;
    background-image: linear-gradient(to right, #1a5ddf, #2580a7);
    border-color: transparent;
    box-shadow: 0 4px 8px rgba(26, 93, 223, 0.3);
    transform: translateY(-1px);
}

/* Success button (for email sent, etc) */
.resource-tools-nda .btn.btn-success,
.resource-tools-nda .btn-success {
    color: #fff;
    background-image: linear-gradient(to right, #198754, #20c997);
    border: none;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(25, 135, 84, 0.2);
}

.resource-tools-nda .btn.btn-success:hover,
.resource-tools-nda .btn-success:hover {
    background-image: linear-gradient(to right, #157347, #1aa179);
    box-shadow: 0 4px 8px rgba(25, 135, 84, 0.3);
    transform: translateY(-1px);
    color: #fff;
}

/* Small button size adjustments */
.resource-tools-nda .btn.btn-sm,
.resource-tools-nda .btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
}

/* Large button for generate NDA */
.resource-tools-nda .btn.btn-lg,
.resource-tools-nda .btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Button icons alignment */
.resource-tools-nda .btn svg,
.resource-tools-nda .btn .dashicons {
    vertical-align: middle;
}

/* Button Group */
.resource-tools-nda .btn-group {
    gap: 0.25rem;
}

/* Validation Feedback */
.resource-tools-nda .invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Download Animation */
@keyframes downloadPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.download-success {
    animation: downloadPulse 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .resource-tools-nda {
        overflow: visible;
        position: relative;
        z-index: 10;
    }
    
    .resource-tools-nda .ccm-form-section {
        padding: 1rem;
    }
    
    .resource-tools-nda .ccm-nda-output {
        padding: 1rem;
        font-size: 0.9rem;
        max-height: none;
        overflow: visible;
        position: relative;
        z-index: 5;
    }
    
    .resource-tools-nda .ccm-nda-output .nda-header h1 {
        font-size: 1.4rem;
    }
    
    .resource-tools-nda .ccm-nda-output h2 {
        font-size: 1.1rem;
    }
    
    .resource-tools-nda .ccm-nda-output h3 {
        font-size: 1rem;
    }
    
    .resource-tools-nda .btn-group {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .resource-tools-nda .btn-group .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        margin-bottom: 0.25rem;
    }
    
    /* Stats grid mobile layout */
    .resource-tools-nda .ccm-stats-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .resource-tools-nda .ccm-stat-box {
        width: 100%;
        min-width: 0;
    }

    /* Signature pad mobile */
    .ccm-signature-section .row {
        flex-direction: column;
    }
    
    .ccm-signature-pad {
        height: 120px;
    }
}

@media (max-width: 576px) {
    .resource-tools-nda {
        margin: 1rem 0;
    }
    
    .resource-tools-nda .ccm-checkbox-item {
        padding: 0.4rem 0.5rem;
    }
    
    .resource-tools-nda .ccm-stat-box strong {
        font-size: 0.95rem;
    }
    
    .resource-tools-nda .ccm-nda-output {
        padding: 0.75rem;
        border-radius: 6px;
    }
    
    .resource-tools-nda .ccm-nda-output .nda-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .resource-tools-nda .ccm-nda-output .nda-section {
        margin-bottom: 1rem;
    }
}

/* Print Styles */
@media print {
    .ccm-nda-output {
        background-color: white;
        border: none;
        box-shadow: none;
        max-height: none;
        overflow: visible;
        padding: 0;
    }
    
    .ccm-nda-output h2 {
        color: #000;
        border-bottom-color: #000;
    }
    
    .ccm-nda-output strong {
        color: #000;
    }
    
    .resource-tools-nda .btn-group,
    .resource-tools-nda .ccm-stat-box {
        display: none !important;
    }

    .ccm-signature-section {
        page-break-inside: avoid;
    }
}

/* PDF Export Specific Styles */
.ccm-nda-pdf-export {
    font-family: 'Times New Roman', Times, serif;
    font-size: 12pt;
    line-height: 1.6;
    color: #000;
    background: #fff;
}

.ccm-nda-pdf-export h1 {
    font-size: 18pt;
    text-align: center;
    margin-bottom: 20pt;
}

.ccm-nda-pdf-export h2 {
    font-size: 14pt;
    margin-top: 18pt;
    margin-bottom: 10pt;
}

.ccm-nda-pdf-export .signature-block {
    margin-top: 40pt;
    page-break-inside: avoid;
}

.ccm-nda-pdf-export .signature-line {
    display: inline-block;
    width: 250px;
    border-bottom: 1px solid #000;
    margin-bottom: 5pt;
}
