/* Pic-Time Connect Admin Styles */

/* ===== HEADER AND BRANDING ===== */
.ptbsb-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
}

.ptbsb-logo {
    width: 40px;
    height: 40px;
    margin-right: 15px;
}

.ptbsb-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.ptbsb-version {
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

/* ===== BRAND CARD ===== */
.ptbsb-brand-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #2271b1;
    padding: 20px;
    margin-bottom: 20px;
}

.ptbsb-brand-header {
    margin-bottom: 15px;
}

.ptbsb-brand-title {
    margin: 0;
    font-size: 18px;
    color: #2271b1;
}

/* ===== UPDATE NOTICES ===== */
.ptbsb-update-notice {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
}

/* ===== MODAL STYLES (Stronger WordPress Override) ===== */
body.wp-admin div#ptbsb-version-history-modal,
body.wp-admin div#ptbsb-selective-mode-modal {
    display: none !important;
    position: fixed !important;
    z-index: 999999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    overflow: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Force show when JavaScript adds style */
body.wp-admin div#ptbsb-version-history-modal[style*="display: block"],
body.wp-admin div#ptbsb-selective-mode-modal[style*="display: block"] {
    display: block !important;
}

body.wp-admin div.ptbsb-modal-content {
    background-color: #ffffff !important;
    margin: 5% auto !important;
    padding: 30px !important;
    border: none !important;
    width: 80% !important;
    max-width: 700px !important;
    border-radius: 6px !important;
    position: relative !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    display: block !important;
}

body.wp-admin span.ptbsb-close {
    color: #999999 !important;
    position: absolute !important;
    right: 20px !important;
    top: 20px !important;
    font-size: 30px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    z-index: 999999 !important;
    line-height: 1 !important;
    width: 30px !important;
    height: 30px !important;
    text-align: center !important;
    display: block !important;
}

body.wp-admin span.ptbsb-close:hover,
body.wp-admin span.ptbsb-close:focus {
    color: #333333 !important;
    background-color: #f0f0f0 !important;
    border-radius: 50% !important;
}

body.wp-admin div.ptbsb-modal h2 {
    color: #2271b1 !important;
    margin-top: 0 !important;
    margin-right: 50px !important;
    font-size: 22px !important;
    padding-right: 20px !important;
}

body.wp-admin div.ptbsb-modal h3 {
    color: #444444 !important;
    border-bottom: 1px solid #dddddd !important;
    padding-bottom: 8px !important;
    margin-top: 25px !important;
    margin-bottom: 15px !important;
}

body.wp-admin div.ptbsb-modal ol,
body.wp-admin div.ptbsb-modal ul {
    margin: 15px 0 !important;
    padding-left: 25px !important;
}

body.wp-admin div.ptbsb-modal li {
    margin-bottom: 8px !important;
    line-height: 1.5 !important;
}

body.wp-admin div.ptbsb-modal pre {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    padding: 15px !important;
    overflow-x: auto !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    margin: 15px 0 !important;
    font-family: 'Courier New', Courier, monospace !important;
}

body.wp-admin div.ptbsb-modal p {
    margin: 10px 0 !important;
    line-height: 1.6 !important;
}

body.wp-admin div.ptbsb-modal code {
    background: #f1f3f4 !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 13px !important;
}

/* ===== BUTTONS AND FORMS ===== */
.ptbsb-button-primary {
    background: #0073aa;
    border: 1px solid #0073aa;
    color: white;
    padding: 8px 16px;
    border-radius: 3px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.ptbsb-button-primary:hover {
    background: #005a87;
    border-color: #005a87;
    color: white;
}

.ptbsb-button-secondary {
    background: #f7f7f7;
    border: 1px solid #ccc;
    color: #555;
    padding: 8px 16px;
    border-radius: 3px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.ptbsb-button-secondary:hover {
    background: #fafafa;
    border-color: #999;
    color: #222;
}

/* ===== FORM IMPROVEMENTS ===== */
.form-table th {
    font-weight: 600;
    color: #2c3e50;
    padding: 15px 10px 15px 0;
}

.form-table td {
    padding: 15px 10px;
}

/* ===== STATUS INDICATORS ===== */
.ptbsb-status-active {
    color: #46b450;
    font-weight: 600;
}

.ptbsb-status-inactive {
    color: #dc3232;
    font-weight: 600;
}

.ptbsb-status-warning {
    color: #ffb900;
    font-weight: 600;
}

/* ===== CARD STYLING ===== */
.card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #2c3e50;
}

/* ===== INFO BOXES ===== */
.ptbsb-info-box {
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    padding: 12px 16px;
    margin: 15px 0;
}

.ptbsb-warning-box {
    background: #fff8e1;
    border-left: 4px solid #ffb900;
    padding: 12px 16px;
    margin: 15px 0;
}

.ptbsb-success-box {
    background: #ecf4ea;
    border-left: 4px solid #46b450;
    padding: 12px 16px;
    margin: 15px 0;
}

/* ===== CODE FORMATTING ===== */
code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 13px;
}

pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    border: 1px solid #ddd;
}

/* ===== SYSTEM INFO TABLE ===== */
.widefat tbody tr td:first-child {
    font-weight: 600;
    width: 30%;
}

/* ===== LOG DISPLAY ===== */
.ptbsb-log-display {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== MAINTENANCE TOOLS ===== */
.ptbsb-maintenance-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin: 15px 0;
}

.ptbsb-maintenance-section h3 {
    margin-top: 0;
    color: #2c3e50;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 782px) {
    .ptbsb-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ptbsb-logo {
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .ptbsb-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .ptbsb-brand-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ptbsb-brand-logo {
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .form-table th {
        border-bottom: none;
        padding-bottom: 5px;
    }
}

/* ===== ADMIN NOTICES INTEGRATION ===== */
.notice.ptbsb-notice {
    border-left-width: 4px;
    border-left-style: solid;
}

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

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

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

/* ===== HELP TEXT STYLING ===== */
.description {
    font-style: italic;
    color: #666;
}

.description strong {
    font-weight: 600;
    color: #333;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.ptbsb-modal:focus-within .ptbsb-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.button:focus,
.button-primary:focus,
.button-secondary:focus {
    box-shadow: 0 0 0 2px #0073aa;
    outline: none;
}

/* ===== LOADING STATES ===== */
.ptbsb-loading {
    opacity: 0.6;
    pointer-events: none;
}

.ptbsb-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: ptbsb-spin 1s linear infinite;
}

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

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .ptbsb-brand-card {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        color: #ecf0f1;
    }
    
    .ptbsb-brand-title {
        color: #3498db;
    }
    
    .ptbsb-modal-content {
        background-color: #2c3e50;
        color: #ecf0f1;
        border-color: #34495e;
    }
    
    .ptbsb-modal h2 {
        color: #3498db;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .ptbsb-modal,
    .button,
    .notice {
        display: none !important;
    }
    
    .ptbsb-header {
        border-bottom: 2px solid #000;
    }
    
    .card {
        border: 1px solid #000;
        margin: 10px 0;
        break-inside: avoid;
    }
}