/* ==========================================================================
   1. Dashboard Controls & Grid
   ========================================================================== */
.apiary-controls input[type="text"] {
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
    font-size: 16px; /* 16px prevents iOS from auto-zooming */
    transition: border-color 0.1s ease-in-out;
}

.apiary-controls input[type="text"]:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.apiary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.apiary-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.apiary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.apiary-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.25em;
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 10px;
}

.apiary-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.apiary-card ul li {
    margin-bottom: 8px;
    font-size: 0.95em;
}

.apiary-card hr {
    border: 0;
    border-top: 1px solid #f0f0f1;
    margin: 15px 0;
}

.apiary-open-modal-btn {
    width: 100%;
    text-align: center;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
    color: #2271b1;
    transition: background 0.1s ease;
}

.apiary-open-modal-btn:hover {
    background: #f0f0f1;
    border-color: #0a4b78;
    color: #0a4b78;
}

/* ==========================================================================
   2. Slide-out Modal
   ========================================================================== */
.apiary-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 550px;
    background: #fff;
    z-index: 999999; /* Ensures it sits over WP admin bars and theme headers */
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    /* CSS Animation for the slide in */
    animation: apiarySlideIn 0.3s ease-out forwards;
}

@keyframes apiarySlideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.apiary-modal-header {
    background: #1d2327;
    color: #fff;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

#apiary-modal-close {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 5px 15px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#apiary-modal-close:hover {
    background: rgba(255,255,255,0.1);
}

#apiary-modal-content {
    padding: 20px;
}

/* ==========================================================================
   3. Badges and Statuses
   ========================================================================== */
.apiary-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* You can customize these colors based on your specific statuses */
.status-active { background: #d1e7dd; color: #0f5132; }
.status-ready-to-split { background: #fff3cd; color: #856404; }
.status-needs-attention { background: #f8d7da; color: #842029; }
.status-deadout { background: #e2e3e5; color: #383d41; }

/* ==========================================================================
   4. Mobile Responsiveness
   ========================================================================== */
@media (max-width: 600px) {
    .apiary-data-grid {
        flex-direction: column;
        gap: 10px;
    }
    
    .apiary-modal {
        max-width: 100%; /* Takes up full screen on mobile */
    }
}