/**
 * Action Menu Modal Styling
 * Provides multiple themes and customization options for action buttons
 */

/* === ACTION MENU MODAL === */
.filemaker-action-menu-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    margin: 50px auto;
    position: relative;
    z-index: 10001;
}

/* === PIPELINE RESULT MODAL === */
.filemaker-pipeline-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    margin: 50px auto;
    position: relative;
    z-index: 10001;
    max-height: 80vh;
    overflow-y: auto;
}

.filemaker-pipeline-modal .filemaker-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.filemaker-pipeline-modal .filemaker-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.filemaker-pipeline-modal .filemaker-modal-body {
    padding: 25px;
}

.filemaker-pipeline-modal .filemaker-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filemaker-pipeline-modal .filemaker-modal-close:hover {
    color: #dc3545;
}

/* === PIPELINE RESULTS TABLE === */
.filemaker-pipeline-results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filemaker-pipeline-results-table thead {
    background: #f8f9fa;
}

.filemaker-pipeline-results-table th,
.filemaker-pipeline-results-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.filemaker-pipeline-results-table th {
    font-weight: 600;
    color: #495057;
    background: #f8f9fa;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filemaker-pipeline-results-table td {
    color: #212529;
    font-size: 14px;
}

.filemaker-pipeline-results-table tbody tr:hover {
    background: #f8f9fa;
}

.filemaker-pipeline-results-table tbody tr:last-child td {
    border-bottom: none;
}

.filemaker-action-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.filemaker-action-menu-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.filemaker-action-menu-body {
    padding: 25px;
}

.filemaker-action-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

/* === ACTION BUTTONS CONTAINER === */
.filemaker-action-buttons {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

/* Two-column layout for more than 3 buttons */
.filemaker-action-buttons:has(.filemaker-action-btn:nth-child(4)) {
    grid-template-columns: 1fr 1fr;
}

/* === BASE ACTION BUTTON STYLES === */
.filemaker-action-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    color: #495057;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 60px;
    position: relative;
    overflow: hidden;
}

.filemaker-action-btn:hover {
    border-color: #007cba;
    background: #f8f9fa;
    color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}

.filemaker-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 124, 186, 0.2);
}

/* Icon styling */
.filemaker-action-btn .dashicons {
    margin-right: 12px;
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* === THEME VARIATIONS === */

/* Primary Theme - Blue accent */
.filemaker-action-buttons.theme-primary .filemaker-action-btn:hover {
    border-color: #007cba;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
}

/* Success Theme - Green accent */
.filemaker-action-buttons.theme-success .filemaker-action-btn:hover {
    border-color: #28a745;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

/* Warning Theme - Orange accent */
.filemaker-action-buttons.theme-warning .filemaker-action-btn:hover {
    border-color: #ffc107;
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

/* Danger Theme - Red accent */
.filemaker-action-buttons.theme-danger .filemaker-action-btn:hover {
    border-color: #dc3545;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

/* === SIZE VARIATIONS === */

/* Compact buttons */
.filemaker-action-buttons.size-compact .filemaker-action-btn {
    padding: 10px 15px;
    font-size: 14px;
    min-height: 45px;
}

.filemaker-action-buttons.size-compact .filemaker-action-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

/* Large buttons */
.filemaker-action-buttons.size-large .filemaker-action-btn {
    padding: 20px 25px;
    font-size: 16px;
    min-height: 80px;
}

.filemaker-action-buttons.size-large .filemaker-action-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-right: 15px;
}

/* === LAYOUT VARIATIONS === */

/* Horizontal layout */
.filemaker-action-buttons.layout-horizontal {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filemaker-action-buttons.layout-horizontal .filemaker-action-btn {
    justify-content: center;
    text-align: center;
}

/* Icon-only layout */
.filemaker-action-buttons.layout-icons-only {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
}

.filemaker-action-buttons.layout-icons-only .filemaker-action-btn {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 15px 10px;
    font-size: 12px;
    min-height: 80px;
}

.filemaker-action-buttons.layout-icons-only .filemaker-action-btn .dashicons {
    margin-right: 0;
    margin-bottom: 8px;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* === INDIVIDUAL BUTTON STYLING BY ACTION TYPE === */

/* Form actions - Blue */
.filemaker-action-btn[data-action-key*="edit"],
.filemaker-action-btn[data-action-key*="form"] {
    border-left: 4px solid #007cba;
}

/* View actions - Green */
.filemaker-action-btn[data-action-key*="view"],
.filemaker-action-btn[data-action-key*="show"] {
    border-left: 4px solid #28a745;
}

/* Print/Export actions - Orange */
.filemaker-action-btn[data-action-key*="print"],
.filemaker-action-btn[data-action-key*="export"],
.filemaker-action-btn[data-action-key*="download"] {
    border-left: 4px solid #ffc107;
}

/* Delete/Danger actions - Red */
.filemaker-action-btn[data-action-key*="delete"],
.filemaker-action-btn[data-action-key*="remove"] {
    border-left: 4px solid #dc3545;
}

/* Analytics/Report actions - Purple */
.filemaker-action-btn[data-action-key*="check"],
.filemaker-action-btn[data-action-key*="report"],
.filemaker-action-btn[data-action-key*="analytics"] {
    border-left: 4px solid #6f42c1;
}

/* === RESPONSIVE DESIGN === */
@media screen and (max-width: 768px) {
    .filemaker-action-menu-modal {
        margin: 20px auto;
        width: 95%;
    }
    
    .filemaker-action-menu-header,
    .filemaker-action-menu-body {
        padding: 15px 20px;
    }
    
    .filemaker-action-buttons {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .filemaker-action-btn {
        padding: 12px 15px;
        font-size: 14px;
        min-height: 50px;
    }
}

@media screen and (max-width: 480px) {
    .filemaker-action-menu-header h3 {
        font-size: 16px;
    }
    
    .filemaker-action-btn {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 45px;
    }
    
    .filemaker-action-btn .dashicons {
        font-size: 18px;
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }
}

/* === ANIMATION EFFECTS === */

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filemaker-action-buttons.animate-fade .filemaker-action-btn {
    animation: fadeInUp 0.3s ease forwards;
}

.filemaker-action-buttons.animate-fade .filemaker-action-btn:nth-child(1) { animation-delay: 0.1s; }
.filemaker-action-buttons.animate-fade .filemaker-action-btn:nth-child(2) { animation-delay: 0.2s; }
.filemaker-action-buttons.animate-fade .filemaker-action-btn:nth-child(3) { animation-delay: 0.3s; }
.filemaker-action-buttons.animate-fade .filemaker-action-btn:nth-child(4) { animation-delay: 0.4s; }
.filemaker-action-buttons.animate-fade .filemaker-action-btn:nth-child(5) { animation-delay: 0.5s; }

/* Ripple effect */
.filemaker-action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 124, 186, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.filemaker-action-btn:active::before {
    width: 300px;
    height: 300px;
}
