/* ==========================================================================
   WPDistro Updates Page (Sleek Theme matched with Settings)
   ========================================================================== */

.wpdistro-home {
    max-width: 1400px;
    margin: 24px auto;
    padding-right: 20px;
    box-sizing: border-box;
}

/* ==========================================================================
   Toolbar & Buttons (Pill-themed & standard elements)
   ========================================================================== */

.wpdistro-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 0 0 24px 0;
    flex-wrap: wrap;
}

.wpdistro-toolbar-left,
.wpdistro-toolbar-right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.wpdistro-home .button-primary {
    background-color: #ff4f00 !important;
    border-color: #ff4f00 !important;
    color: #ffffff !important;
    height: 38px;
    padding: 0 18px !important;
    border-radius: 50px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    box-shadow: 0 2px 4px rgba(255, 79, 0, 0.2);
    transition: background-color 0.2s ease;
}

.wpdistro-home .button-primary:hover,
.wpdistro-home .button-primary:focus {
    background-color: #e04400 !important;
    border-color: #e04400 !important;
    color: #ffffff !important;
}

.wpdistro-home .button-primary[disabled],
.wpdistro-home .button-primary:disabled {
    background-color: #f6f7f7 !important;
    border-color: #dcdcde !important;
    color: #a7aaad !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

/* ==========================================================================
   Update Bar Summary Banner
   ========================================================================== */

.wpdistro-update-bar {
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.wpdistro-update-bar .title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

#wpdistro-update-summary {
    margin: 0;
    color: #646970;
    font-size: 14px;
}

/* ==========================================================================
   Grid & Cards Layout
   ========================================================================== */

.wpdistro-home .wpdistro-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
    margin-top: 0 !important;
}

.wpdistro-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    overflow: hidden;
    width: 100% !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.wpdistro-card h2 {
    margin: 0;
    padding: 18px 24px;
    background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.wpdistro-card table {
    width: 100% !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.wpdistro-card thead th {
    padding: 14px 20px;
    font-weight: 600;
    color: #1d2327;
    background: #fff;
    border-bottom: 1px solid #dcdcde;
}

.wpdistro-card tbody td {
    padding: 16px 20px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f1;
    color: #2c3338;
}

.wpdistro-card tbody tr:last-child td {
    border-bottom: none;
}

.wpdistro-card tbody tr:hover {
    background: #f9f9f9;
}

/* Status Badges */
.wpdistro-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.wpdistro-badge-warning {
    background: #fff8e5;
    color: #946200;
    border: 1px solid #fbeecc;
}

/* Table Item Action Button inside Rows */
.wpdistro-card .wpdistro-update {
    background: #fff !important;
    border: 1px solid #2271b1 !important;
    color: #2271b1 !important;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpdistro-card .wpdistro-update:hover {
    background: #2271b1 !important;
    color: #fff !important;
}

/* ==========================================================================
   Progress Overlay Modal
   ========================================================================== */

.wpdistro-progress[hidden] {
    display: none !important;
}

.wpdistro-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.wpdistro-progress-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    text-align: center;
}

.wpdistro-progress-card h2 {
    margin-top: 0;
    font-size: 18px;
    color: #1d2327;
}

.wpdistro-progress-bar {
    background: #f0f0f1;
    border-radius: 50px;
    height: 10px;
    overflow: hidden;
    margin: 20px 0 10px;
}

.wpdistro-progress-fill {
    background: #ff4f00;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

#wpdistro-progress-count {
    color: #646970;
    font-size: 13px;
    margin: 0;
}

/* ==========================================================================
   Responsive Queries
   ========================================================================== */

@media (max-width: 1100px) {
    .wpdistro-home .wpdistro-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 782px) {
    .wpdistro-home {
        margin: 16px;
        padding-right: 0;
    }

    .wpdistro-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wpdistro-card thead { 
        display: none; 
    }
    
    .wpdistro-card table, 
    .wpdistro-card tr, 
    .wpdistro-card td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .wpdistro-card tbody td {
        padding: 10px 16px;
        border-bottom: none;
    }

    .wpdistro-card tbody tr {
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f1;
        display: block;
    }
}