/**
 * Share Campaign Modal Styles
 * 
 * @package ProofPoints_AI_Integration
 * @since 21.0.0
 */

/* ============================================
   MODAL OVERLAY & CONTAINER
   ============================================ */

.pp-share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.pp-share-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 1400px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: ppShareModalIn 0.25s ease-out;
}

@keyframes ppShareModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Prevent body scroll when modal is open */
body.pp-modal-open {
    overflow: hidden;
}

/* ============================================
   MODAL HEADER
   ============================================ */

.pp-share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 2px solid #e5e7eb;
    background: white;
}

.pp-share-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1e2835;
}

.pp-share-modal-title svg {
    color: #667eea;
}

.pp-share-modal-close {
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pp-share-modal-close:hover {
    background: #e5e7eb;
    color: #1e2835;
}

/* ============================================
   MODAL BODY
   ============================================ */

.pp-share-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* 3-column grid on desktop */
@media (min-width: 1024px) {
    .pp-share-modal-body {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        grid-template-areas:
            "campaign campaign campaign"
            "url params reference";
    }
    
    .pp-share-campaign-name {
        grid-area: campaign;
    }
    
    .pp-share-section:nth-of-type(1) {
        grid-area: url;
    }
    
    .pp-share-section:nth-of-type(2) {
        grid-area: params;
    }
    
    .pp-share-section:nth-of-type(3) {
        grid-area: reference;
    }
    
    /* Remove bottom borders in grid layout */
    .pp-share-section {
        border-bottom: none !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
}

/* Campaign Name */
.pp-share-campaign-name {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.pp-share-label {
    font-family: 'Lexend Deca', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pp-share-name {
    font-family: 'Lexend Deca', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1e2835;
}

/* ============================================
   SECTIONS
   ============================================ */

.pp-share-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.pp-share-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.pp-share-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.pp-share-section-header.clickable {
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.pp-share-section-header.clickable:hover {
    background: #f3f4f6;
}

.pp-share-section-icon {
    font-size: 18px;
}

.pp-share-section-title {
    font-family: 'Lexend Deca', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1e2835;
}

.pp-share-section-badge {
    font-family: 'Lexend Deca', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    background: #e5e7eb;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pp-share-toggle-icon {
    margin-left: auto;
    color: #9ca3af;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.pp-share-section.collapsed .pp-share-toggle-icon {
    transform: rotate(-90deg);
}

.pp-share-section.collapsed .pp-share-reference-content {
    display: none;
}

.pp-share-description {
    font-family: 'Lexend Deca', sans-serif;
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.pp-share-hint {
    font-family: 'Lexend Deca', sans-serif;
    font-size: 12px;
    color: #9ca3af;
    margin: 8px 0 0 0;
}

/* ============================================
   URL BOX
   ============================================ */

.pp-share-url-box {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.pp-share-url-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: #374151;
    background: #f9fafb;
    outline: none;
    transition: all 0.2s ease;
}

.pp-share-url-input:focus {
    border-color: #9C27B0;
    background: white;
    box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.1);
}

.pp-share-url-input.personalized {
    background: white;
    border-color: #d1d5db;
}

.pp-share-url-input.personalized.has-params {
    border-color: #667eea;
    background: #f0f3ff;
}

.pp-share-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: #81b000;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pp-share-copy-btn:hover {
    background: #6a9400;
    transform: translateY(-1px);
}

.pp-share-copy-btn.primary {
    background: #81b000;
}

.pp-share-copy-btn.primary:hover {
    background: #6a9400;
}

.pp-share-copy-btn.copied {
    background: #10b981 !important;
}

.pp-share-copy-btn.error {
    background: #ef4444 !important;
}

.pp-share-copy-btn svg {
    flex-shrink: 0;
}

/* ============================================
   PARAMETERS GRID
   ============================================ */

.pp-share-params-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.pp-share-param label {
    display: block;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 6px;
}

.pp-share-param-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 14px;
    color: #1e2835;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.pp-share-param-input:focus {
    border-color: #9C27B0;
    box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.1);
}

.pp-share-param-input::placeholder {
    color: #9ca3af;
}

/* Preview Box */
.pp-share-preview-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
}

.pp-share-preview-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.pp-share-clear-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pp-share-clear-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   REFERENCE TABLE
   ============================================ */

.pp-share-reference-content {
    margin-top: 12px;
}

.pp-share-reference-content p {
    font-family: 'Lexend Deca', sans-serif;
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px 0;
}

.pp-share-params-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 13px;
    margin-bottom: 16px;
}

.pp-share-params-table th {
    text-align: left;
    padding: 10px 12px;
    background: #f3f4f6;
    color: #4b5563;
    font-weight: 500;
    border-bottom: 1px solid #e5e7eb;
}

.pp-share-params-table th:first-child {
    border-radius: 8px 0 0 0;
}

.pp-share-params-table th:last-child {
    border-radius: 0 8px 0 0;
}

.pp-share-params-table td {
    padding: 10px 12px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.pp-share-params-table code {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    color: #7c3aed;
}

.pp-share-example {
    background: #f3f4f6;
    padding: 12px 16px;
    border-radius: 8px;
}

.pp-share-example strong {
    display: block;
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 8px;
}

.pp-share-example code {
    display: block;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    color: #6b7280;
    word-break: break-all;
    line-height: 1.6;
}

/* ============================================
   EMAIL SECTION
   ============================================ */

.pp-share-section.email-section {
    background: #f8f9fa;
    margin: 0 -32px -32px -32px;
    padding: 32px;
    border-bottom: none;
    border-radius: 0 0 16px 16px;
    border-top: 2px solid #e5e7eb;
}

.pp-share-email-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.pp-share-email-btn:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.pp-share-email-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.pp-share-email-btn.sent {
    background: #10b981 !important;
}

.pp-share-email-btn.error {
    background: #ef4444 !important;
}

.pp-share-email-note {
    font-family: 'Lexend Deca', sans-serif;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    margin: 0;
}

/* Spinner animation */
.pp-share-email-btn .pp-spinner {
    animation: ppSpinnerRotate 1s linear infinite;
}

@keyframes ppSpinnerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   MODAL FOOTER
   ============================================ */

.pp-share-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

/* Email button in footer - pink with white text, narrow width */
.pp-share-modal-footer .pp-share-email-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: auto !important;
    padding: 8px 16px !important;
    background: #9C27B0 !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    font-family: 'Lexend Deca', sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    margin-bottom: 0 !important;
    transform: none !important;
    box-shadow: none !important;
}

.pp-share-modal-footer .pp-share-email-btn:hover {
    background: #7B1FA2 !important;
    transform: none !important;
    box-shadow: none !important;
}

.pp-share-modal-footer .pp-share-email-btn svg {
    flex-shrink: 0;
}

.pp-share-done-btn {
    padding: 8px 20px;
    background: #1f2937;
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pp-share-done-btn:hover {
    background: #374151;
}

/* ============================================
   SHARE BUTTON IN TABLE
   ============================================ */

.pp-action-btn.share {
    background: #6b7280 !important;
    color: white !important;
    border: none !important;
}

.pp-action-btn.share:hover {
    background: #4b5563 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .pp-share-modal-overlay {
        padding: 10px;
    }
    
    .pp-share-modal {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .pp-share-modal-header {
        padding: 16px 20px;
    }
    
    .pp-share-modal-body {
        padding: 20px;
    }
    
    .pp-share-params-grid {
        grid-template-columns: 1fr;
    }
    
    .pp-share-url-box {
        flex-direction: column;
    }
    
    .pp-share-copy-btn {
        justify-content: center;
    }
    
    .pp-share-section.email-section {
        margin: 0 -20px -20px -20px;
        padding: 20px;
    }
}
