/**
 * Venue Policy Matrix - Frontend Styles
 */

/* General Notice Styles */
.vpm-notice {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.vpm-notice-info {
    background: #e7f3ff;
    border-left: 4px solid #2271b1;
    color: #1d4ed8;
}

.vpm-notice-error {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    color: #dc2626;
}

.vpm-notice-success {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
    color: #166534;
}

/* Button Styles */
.vpm-btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.vpm-btn:hover {
    text-decoration: none;
}

.vpm-btn-primary {
    background: #2271b1;
    color: #fff;
}

.vpm-btn-primary:hover {
    background: #135e96;
    color: #fff;
}

.vpm-btn-secondary {
    background: #f0f0f1;
    color: #1d2327;
    border: 1px solid #c3c4c7;
}

.vpm-btn-secondary:hover {
    background: #e2e4e7;
    color: #1d2327;
}

.vpm-btn-outline {
    background: transparent;
    color: #2271b1;
    border: 1px solid #2271b1;
}

.vpm-btn-outline:hover {
    background: #2271b1;
    color: #fff;
}

.vpm-btn-text {
    background: transparent;
    color: #2271b1;
    padding: 8px 12px;
}

.vpm-btn-text:hover {
    color: #135e96;
    text-decoration: underline;
}

.vpm-btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

.vpm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Policy Matrix Table */
.vpm-policy-matrix-container {
    width: 100%;
}

.vpm-policy-matrix-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    min-width: 1000px;
    position: relative;
}

/* Scroll hint for mobile */
.vpm-policy-matrix-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.vpm-policy-matrix-wrapper.has-scroll::after {
    opacity: 1;
}

.vpm-policy-matrix-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #d1d5db;
}

.vpm-policy-matrix-table th,
.vpm-policy-matrix-table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #d1d5db;
    vertical-align: top;
}

.vpm-policy-matrix-table th:last-child,
.vpm-policy-matrix-table td:last-child {
    text-align: right;
    overflow: visible;
}

.vpm-policy-matrix-table thead th {
    background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #9ca3af;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.vpm-policy-matrix-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.vpm-policy-matrix-table tbody tr:hover {
    background: #eef2ff;
}

/* Sticky first column for venue name */
.vpm-policy-matrix-table th:first-child,
.vpm-policy-matrix-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background: #fff;
    border-right: 2px solid #9ca3af;
}

.vpm-policy-matrix-table thead th:first-child {
    z-index: 15;
    background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
}

.vpm-policy-matrix-table tbody tr:nth-child(even) td:first-child {
    background: #f9fafb;
}

.vpm-policy-matrix-table tbody tr:hover td:first-child {
    background: #eef2ff;
}

/* Column widths */
.vpm-venue-name {
    min-width: 180px;
}

.vpm-field-cell {
    min-width: 150px;
}

.vpm-field-content {
    max-height: 120px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
    padding-right: 5px;
    word-wrap: break-word;
}

/* Custom scrollbar for field content */
.vpm-field-content::-webkit-scrollbar {
    width: 4px;
}

.vpm-field-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.vpm-field-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.vpm-field-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.vpm-actions-cell {
    min-width: 180px;
    white-space: nowrap;
    text-align: right;
    background: #fff;
    border-left: 2px solid #9ca3af;
}

.vpm-policy-matrix-table tbody tr:nth-child(even) .vpm-actions-cell {
    background: #f9fafb;
}

.vpm-policy-matrix-table tbody tr:hover .vpm-actions-cell {
    background: #eef2ff;
}

.vpm-actions-cell .vpm-btn {
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Mobile scroll indicator */
.vpm-scroll-hint {
    display: none;
    text-align: center;
    padding: 8px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.vpm-scroll-hint svg {
    vertical-align: middle;
    margin-right: 5px;
}

/* Request/Question Form Rows */
.vpm-request-form-row td,
.vpm-question-form-row td {
    background: #f8fafc;
    padding: 0;
}

.vpm-request-form,
.vpm-question-form {
    padding: 20px;
    border-top: 2px solid #2271b1;
}

.vpm-request-form h4,
.vpm-question-form h4 {
    margin: 0 0 15px;
    color: #1e3a5f;
}

/* Form Fields */
.vpm-form-field {
    margin-bottom: 15px;
}

.vpm-form-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #374151;
}

.vpm-form-field input[type="text"],
.vpm-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.vpm-form-field input[type="text"]:focus,
.vpm-form-field textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.vpm-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.vpm-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.vpm-form-message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 4px;
    display: none;
}

.vpm-form-message.success {
    display: block;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.vpm-form-message.error {
    display: block;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Policy Editor */
.vpm-editor-wrapper {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
}

.vpm-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.vpm-editor-header h2 {
    margin: 0;
    color: #1e3a5f;
}

.vpm-editor-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.vpm-editor-fields {
    margin-bottom: 30px;
}

.vpm-editor-field {
    margin-bottom: 25px;
}

.vpm-editor-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e3a5f;
}

.vpm-editor-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease;
}

.vpm-editor-field textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.vpm-field-description {
    margin: 5px 0 0;
    font-size: 13px;
    color: #6b7280;
}

.vpm-editor-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.vpm-editor-note {
    margin-top: 15px;
    font-size: 13px;
    color: #6b7280;
}

.vpm-editor-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    display: none;
}

.vpm-editor-message.success {
    display: block;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.vpm-editor-message.error {
    display: block;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Loading State */
.vpm-loading {
    position: relative;
    pointer-events: none;
}

.vpm-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .vpm-scroll-hint {
        display: block;
    }
    
    .vpm-policy-matrix-wrapper {
        position: relative;
        margin: 0 -15px 20px;
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .vpm-policy-matrix-table {
        font-size: 13px;
    }

    .vpm-policy-matrix-table th,
    .vpm-policy-matrix-table td {
        padding: 10px 12px;
    }
    
    .vpm-venue-name {
        min-width: 120px;
        max-width: 150px;
    }
    
    .vpm-field-cell {
        min-width: 150px;
        max-width: 200px;
    }
    
    .vpm-field-content {
        max-height: 80px;
        font-size: 12px;
    }
    
    .vpm-actions-cell {
        min-width: 120px;
    }
    
    .vpm-actions-cell .vpm-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .vpm-editor-wrapper {
        padding: 0 10px;
    }

    .vpm-editor-form {
        padding: 20px;
    }

    .vpm-editor-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .vpm-form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .vpm-policy-matrix-table {
        font-size: 12px;
    }
    
    .vpm-policy-matrix-table th,
    .vpm-policy-matrix-table td {
        padding: 8px 10px;
    }
    
    .vpm-venue-name {
        min-width: 100px;
        max-width: 120px;
    }
    
    .vpm-field-cell {
        min-width: 120px;
        max-width: 150px;
    }
    
    .vpm-actions-cell {
        min-width: 100px;
        padding: 8px;
    }
    
    .vpm-actions-cell .vpm-btn {
        display: block;
        margin-right: 0;
        text-align: center;
        width: 100%;
    }
    
    .vpm-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .vpm-btn-large {
        padding: 10px 18px;
        font-size: 14px;
    }
}
