/**
 * Department Workflow Enhanced Styles
 * 
 * @package DepartmentWorkflow
 * @since 2.1.0
 */

/* ==========================================================================
   General Admin Styles
   ========================================================================== */

.dw-admin-header {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #0073aa;
}

.dw-admin-header p {
    margin: 0 0 10px 0;
}

.dw-admin-header p:last-child {
    margin-bottom: 0;
}

.nav-tab-wrapper {
    margin-top: 20px;
}

#dw-tab-content {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    min-height: 400px;
}

.dw-loading-spinner {
    text-align: center;
    padding: 40px;
}

.dw-loading-spinner .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: dw-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes dw-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.button-small {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.4;
    height: auto;
}

.approve-post,
.approve-post-inline {
    background: #46b450;
    border-color: #46b450;
    color: #fff;
}

.approve-post:hover,
.approve-post:focus,
.approve-post-inline:hover,
.approve-post-inline:focus {
    background: #3ba746;
    border-color: #3ba746;
    color: #fff;
}

.reject-post,
.reject-post-inline {
    background: #dc3232;
    border-color: #dc3232;
    color: #fff;
}

.reject-post:hover,
.reject-post:focus,
.reject-post-inline:hover,
.reject-post-inline:focus {
    background: #b32d2e;
    border-color: #b32d2e;
    color: #fff;
}

/* ==========================================================================
   Bulk Actions
   ========================================================================== */

.dw-bulk-actions {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dw-bulk-actions .button {
    margin-left: 5px;
}

.dw-pagination {
    margin-top: 20px;
    text-align: center;
}

.dw-pagination .button {
    margin: 2px;
}

/* ==========================================================================
   Table Enhancements
   ========================================================================== */

.wp-list-table .row-actions {
    color: #666;
    font-size: 13px;
    margin-top: 5px;
}

.wp-list-table .row-actions a {
    color: #0073aa;
    text-decoration: none;
}

.wp-list-table .row-actions a:hover {
    text-decoration: underline;
}

.wp-list-table .check-column {
    width: 2.5em;
    padding: 8px 0 0 3px;
}

.wp-list-table .column-cb {
    width: 2.5em;
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.dw-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.dw-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    border: 1px solid #888;
    border-radius: 4px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.dw-modal-header {
    padding: 20px;
    background-color: #f1f1f1;
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dw-modal-header h3 {
    margin: 0;
}

.dw-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.dw-modal-close:hover {
    color: black;
}

.dw-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.dw-modal-footer {
    padding: 15px 20px;
    background-color: #f1f1f1;
    border-top: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    text-align: right;
}

.dw-modal-footer .button {
    margin-left: 5px;
}

.dw-form-group {
    margin-bottom: 15px;
}

.dw-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.dw-form-group select,
.dw-form-group input[type="text"],
.dw-form-group input[type="email"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.button-delete {
    background: #dc3232;
    border-color: #dc3232;
    color: #fff;
}

.button-delete:hover,
.button-delete:focus {
    background: #b32d2e;
    border-color: #b32d2e;
    color: #fff;
}

/* ==========================================================================
   Statistics Grid
   ========================================================================== */

.dw-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.dw-stat-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e2e2e2;
    transition: box-shadow 0.2s ease;
}

.dw-stat-box:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dw-stat-box h3 {
    margin: 0 0 10px 0;
    font-size: 36px;
    font-weight: bold;
    color: #0073aa;
    line-height: 1;
}

.dw-stat-box p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 14px;
}

/* ==========================================================================
   Workflow Status
   ========================================================================== */

.dw-workflow-status {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.dw-workflow-status p {
    margin: 0 0 10px 0;
}

.dw-workflow-status p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Post Status Display
   ========================================================================== */

.status-pending_superadmin {
    color: #d63384 !important;
    font-weight: 600;
}

.post-state-pending_superadmin::before {
    content: "— ";
}

.post-state-pending_superadmin {
    color: #d63384;
    font-weight: 600;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.dw-settings-form {
    max-width: 800px;
}

.dw-settings-form .form-table th {
    width: 200px;
}

.dw-settings-form fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

.dw-settings-form fieldset label {
    display: block;
    margin: 10px 0;
}

.dw-settings-form fieldset label input[type="radio"],
.dw-settings-form fieldset label input[type="checkbox"] {
    margin-right: 8px;
}

/* ==========================================================================
   Notice Styles
   ========================================================================== */

.notice.notice-info {
    border-left-color: #0073aa;
}

.notice.notice-warning {
    border-left-color: #ffb900;
}

.notice.notice-error {
    border-left-color: #dc3232;
}

.notice.notice-success {
    border-left-color: #46b450;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 782px) {
    .dw-stats-grid {
        grid-template-columns: 1fr;
    }

    .dw-admin-header {
        padding: 15px;
        margin: 15px 0;
    }

    #dw-tab-content {
        padding: 15px;
    }

    .dw-modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .dw-modal-header,
    .dw-modal-body,
    .dw-modal-footer {
        padding: 15px;
    }

    .dw-bulk-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .dw-bulk-actions > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .button-small {
        padding: 6px 10px;
        margin: 2px;
    }
}

@media (max-width: 600px) {
    .dw-stat-box h3 {
        font-size: 24px;
    }

    .nav-tab-wrapper .nav-tab {
        font-size: 14px;
        padding: 8px 12px;
    }

    .wp-list-table th,
    .wp-list-table td {
        padding: 8px 4px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .dw-admin-header,
    .nav-tab-wrapper,
    .button,
    .notice {
        display: none;
    }

    #dw-tab-content {
        border: none;
        padding: 0;
    }

    .dw-modal {
        display: none !important;
    }
}
