/* =========================================
   1. Trigger Button
   ========================================= */
.wpfub-btn-gh-note {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    padding: 5px;
    color: #555;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.wpfub-btn-gh-note:hover {
    background-color: #f0f0f1;
    color: #0073aa; /* WordPress Blue */
    border-color: #0073aa;
}

.wpfub-btn-gh-note svg {
    width: 18px;
    height: 18px;
}

/* =========================================
   2. Modal Overlay
   ========================================= */
.wpfub-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 100005; /* High z-index to sit on top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
    backdrop-filter: blur(2px); /* Optional: adds blur effect to background */
}

/* =========================================
   3. Modal Content Box
   ========================================= */
.wpfub-modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 5% from the top and centered */
    padding: 0;
    border: 1px solid #888;
    width: 600px;
    max-width: 90%; /* Responsive width */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: wpfubFadeIn 0.3s;
    display: flex;
    flex-direction: column;
}

@keyframes wpfubFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   4. Modal Header
   ========================================= */
.wpfub-modal-header {
    padding: 15px 20px;
    background-color: #23282d; /* WordPress Admin Dark Bar Color */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.wpfub-modal-header h2 {
    margin: 0;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

/* Close Button */
.wpfub-gh-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.wpfub-gh-close:hover,
.wpfub-gh-close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

/* =========================================
   5. Modal Body (Fixed Height with Scroll)
   ========================================= */
.wpfub-modal-body {
    padding: 20px;
    background-color: #f9fafb;
    height: 400px; 
    overflow-y: auto;
    border-bottom: 1px solid #e5e5e5;
}

.wpfub-modal-body::-webkit-scrollbar {
    width: 8px;
}
.wpfub-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.wpfub-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
.wpfub-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading State */
#wpfub-gh-loading {
    display: none;
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

/* =========================================
   6. Notes List Styling
   ========================================= */
.wpfub-gh-note-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.wpfub-gh-note-list li {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.1s;
}

.wpfub-gh-note-list li:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wpfub-gh-note-list .note-date {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 8px;
    display: block;
    font-weight: 500;
}

.wpfub-gh-note-list .note-content {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

/* Scrollbar styling for the modal body */
.wpfub-modal-body::-webkit-scrollbar {
    width: 8px;
}
.wpfub-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.wpfub-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
.wpfub-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Footer Styling */
.wpfub-modal-footer {
    padding: 15px 20px;
    background-color: #f0f0f1;
    border-top: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* =========================================
   TextArea Styling with Theme Variables
   ========================================= */
#wpfub-gh-new-note-text {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
    
    /* Request: Use theme variable for text color */
    color: var(--color_1, #333); /* Fallback to #333 if var not found */
    background-color: #fff;
}

#wpfub-gh-new-note-text:focus {
    border-color: var(--color_1, #2271b1);
    box-shadow: 0 0 0 1px var(--color_1, #2271b1);
    outline: none;
}

/* Request: Placeholder Color */
#wpfub-gh-new-note-text::placeholder {
    color: var(--color_1, #888);
    opacity: 0.7; /* Make it slightly lighter than main text */
}

/* Cross-browser placeholder support */
#wpfub-gh-new-note-text::-webkit-input-placeholder {
    color: var(--color_1, #888);
    opacity: 0.7;
}
#wpfub-gh-new-note-text::-moz-placeholder {
    color: var(--color_1, #888);
    opacity: 0.7;
}
#wpfub-gh-new-note-text:-ms-input-placeholder {
    color: var(--color_1, #888);
    opacity: 0.7;
}

/* Submit Button */
#wpfub-gh-submit-note {
    align-self: flex-end; /* Align to the right */
    background-color: #2271b1;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

#wpfub-gh-submit-note:hover {
    background-color: #135e96;
}

#wpfub-gh-submit-note:disabled {
    background-color: #a7aaad;
    cursor: not-allowed;
}