/**
 * AEOPress Admin Styles
 * @package AEOPress
 * @since 1.0.0
 * @updated 2.0.0
 */

/* ==========================================================================
   General Admin Styles
   ========================================================================== */

.aeopress-settings {
    background: #fff;
    padding: 20px;
    margin: 20px 20px 20px 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.aeopress-settings h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    margin-bottom: 10px;
}

.aeopress-settings h1 .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #2271b1;
}

.aeopress-settings > p.description {
    font-size: 14px;
    color: #646970;
    margin-bottom: 20px;
}

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */

.aeopress-settings .nav-tab-wrapper {
    margin: 20px 0;
    border-bottom: 1px solid #c3c4c7;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.aeopress-settings .nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.aeopress-settings .nav-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.aeopress-settings .nav-tab:hover {
    background-color: #f0f0f1;
}

.aeopress-settings .nav-tab-active {
    background-color: #fff;
    border-bottom: 2px solid #2271b1;
    color: #2271b1;
}

/* ==========================================================================
   Tab Content
   ========================================================================== */

.aeopress-tab-content {
    padding: 30px 20px;
    background: #fff;
}

.aeopress-tab-content h2 {
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 15px;
    color: #1d2327;
}

.aeopress-tab-content h3 {
    font-size: 17px;
    margin-top: 30px;
    margin-bottom: 12px;
    color: #1d2327;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f1;
}

.aeopress-tab-content > p.description {
    font-size: 14px;
    color: #646970;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* ==========================================================================
   Welcome Panel (General Tab)
   ========================================================================== */

.aeopress-welcome-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.aeopress-welcome-content h3 {
    color: #fff;
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 10px;
    border-bottom: none;
    padding-bottom: 0;
}

.aeopress-welcome-content h3:first-child {
    margin-top: 0;
}

.aeopress-welcome-content p {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
    opacity: 0.95;
}

.aeopress-welcome-content ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.aeopress-welcome-content ul li {
    padding: 8px 0;
    font-size: 15px;
    opacity: 0.95;
}

.aeopress-welcome-content ol {
    padding-left: 20px;
    margin: 15px 0;
}

.aeopress-welcome-content ol li {
    padding: 5px 0;
    font-size: 15px;
    opacity: 0.95;
}

/* Quick Stats */
.aeopress-quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-box .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
}

.stat-box strong {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    opacity: 0.8;
}

.stat-box .status-active {
    display: inline-block;
    padding: 4px 12px;
    background: #00d084;
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
}

/* ==========================================================================
   Form Table Improvements
   ========================================================================== */

.aeopress-tab-content .form-table {
    margin-top: 20px;
}

.aeopress-tab-content .form-table th {
    padding: 20px 10px 20px 0;
    vertical-align: top;
    width: 200px;
}

.aeopress-tab-content .form-table td {
    padding: 15px 10px;
}

.aeopress-tab-content .form-table th label {
    font-weight: 600;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aeopress-tab-content .form-table th label .dashicons {
    color: #2271b1;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.aeopress-tab-content .form-table input[type="text"],
.aeopress-tab-content .form-table input[type="url"],
.aeopress-tab-content .form-table input[type="email"],
.aeopress-tab-content .form-table input[type="tel"],
.aeopress-tab-content .form-table input[type="number"],
.aeopress-tab-content .form-table input[type="date"],
.aeopress-tab-content .form-table textarea,
.aeopress-tab-content .form-table select {
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.aeopress-tab-content .form-table input[type="text"]:focus,
.aeopress-tab-content .form-table input[type="url"]:focus,
.aeopress-tab-content .form-table input[type="email"]:focus,
.aeopress-tab-content .form-table input[type="tel"]:focus,
.aeopress-tab-content .form-table textarea:focus,
.aeopress-tab-content .form-table select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.aeopress-tab-content .form-table p.description {
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 13px;
    color: #646970;
    line-height: 1.5;
}

/* ==========================================================================
   Image Upload Field
   ========================================================================== */

.aeopress-image-upload {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aeopress-image-upload .aeopress-image-url {
    width: 100%;
    max-width: 500px;
}

.aeopress-upload-button {
    align-self: flex-start;
}

.aeopress-image-preview {
    margin-top: 10px;
    padding: 15px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    text-align: center;
}

.aeopress-image-preview img {
    max-width: 150px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aeopress-image-preview:empty {
    display: none;
}

/* ==========================================================================
   Checkboxes and Fieldsets
   ========================================================================== */

.aeopress-tab-content fieldset {
    padding: 0;
    margin: 0;
    border: 0;
}

.aeopress-tab-content fieldset label {
    display: block;
    padding: 12px;
    margin-bottom: 8px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aeopress-tab-content fieldset label:hover {
    background: #fff;
    border-color: #2271b1;
}

.aeopress-tab-content fieldset label input[type="checkbox"] {
    margin-right: 8px;
}

.aeopress-tab-content fieldset label strong {
    color: #1d2327;
    font-size: 14px;
}

.aeopress-tab-content fieldset label code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #50575e;
    margin-left: 8px;
}

.aeopress-tab-content fieldset label p.description {
    margin: 8px 0 0 24px;
    font-size: 13px;
    color: #646970;
}

/* ==========================================================================
   Info Boxes
   ========================================================================== */

.aeopress-info-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 20px;
    background: #e7f5fe;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    margin: 25px 0;
}

.aeopress-info-box .dashicons {
    color: #2271b1;
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.aeopress-info-box strong {
    color: #1d2327;
}

.aeopress-info-box p {
    margin: 4px 0;
    font-size: 14px;
}

.aeopress-info-box a {
    color: #2271b1;
    word-break: break-all;
}

/* ==========================================================================
   Conflict Warning (Meta Tags Tab)
   ========================================================================== */

.aeopress-conflict-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 20px;
    background: #fcf0e3;
    border-left: 4px solid #dba617;
    border-radius: 4px;
    margin: 20px 0;
    color: #6e4b00;
    line-height: 1.5;
}

.aeopress-conflict-warning .dashicons {
    color: #dba617;
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.aeopress-conflict-warning strong {
    color: #6e4b00;
}

/* ==========================================================================
   Hours Grid (LocalBusiness Tab)
   ========================================================================== */

.aeopress-hours-grid {
    max-width: 650px;
    margin: 15px 0;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    border-collapse: collapse;
}

.aeopress-hours-grid thead th {
    background: #f6f7f7;
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    text-align: left;
    border-bottom: 1px solid #dcdcde;
}

.aeopress-hours-grid tbody td {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: middle;
}

.aeopress-hours-grid tbody tr:last-child td {
    border-bottom: none;
}

.aeopress-hours-grid input[type="time"] {
    padding: 6px 10px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 13px;
    width: 130px;
}

.aeopress-hours-grid input[type="time"]:disabled {
    background: #f6f7f7;
    color: #a7aaad;
    cursor: not-allowed;
}

.aeopress-hours-grid label {
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.aeopress-hours-grid tbody tr.aeopress-day-is-closed td {
    opacity: 0.5;
}

.aeopress-hours-grid tbody tr.aeopress-day-is-closed td:last-child {
    opacity: 1;
}

/* ==========================================================================
   LLMs.txt Preview
   ========================================================================== */

.aeopress-llms-preview {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 15px;
    resize: vertical;
    color: #1d2327;
    width: 100%;
    max-width: 800px;
}

/* ==========================================================================
   Tools Grid (Tools Tab)
   ========================================================================== */

.aeopress-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.tool-box {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 25px;
    transition: all 0.3s ease;
}

.tool-box:hover {
    border-color: #2271b1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.tool-box h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    margin: 0 0 15px 0;
    color: #1d2327;
    border-bottom: none;
    padding-bottom: 0;
}

.tool-box h3 .dashicons {
    color: #2271b1;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.tool-box p {
    font-size: 14px;
    color: #646970;
    line-height: 1.6;
    margin-bottom: 20px;
}

.tool-box .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tool-box .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Status Table (Tools Tab)
   ========================================================================== */

.aeopress-tab-content .widefat {
    margin-top: 20px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.aeopress-tab-content .widefat td {
    padding: 15px;
}

.aeopress-tab-content .widefat strong {
    color: #1d2327;
}

.aeopress-status-active {
    color: #00a32a;
    font-weight: 600;
}

.aeopress-status-inactive {
    color: #d63638;
    font-weight: 600;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.aeopress-tab-content .submit {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dcdcde;
}

.aeopress-tab-content .button-primary {
    padding: 8px 24px;
    font-size: 14px;
    height: auto;
    background: #2271b1;
    border-color: #2271b1;
    transition: all 0.2s ease;
}

.aeopress-tab-content .button-primary:hover,
.aeopress-tab-content .button-primary:focus {
    background: #135e96;
    border-color: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 782px) {
    .aeopress-settings {
        margin: 20px 10px 0 0;
        padding: 15px;
    }

    .aeopress-welcome-panel {
        padding: 25px 20px;
    }

    .aeopress-quick-stats {
        grid-template-columns: 1fr;
    }

    .aeopress-tools-grid {
        grid-template-columns: 1fr;
    }

    .aeopress-tab-content .form-table th,
    .aeopress-tab-content .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }

    .aeopress-tab-content .form-table th {
        padding-bottom: 5px;
    }

    .aeopress-image-upload .aeopress-image-url {
        max-width: 100%;
    }

    .aeopress-hours-grid {
        max-width: 100%;
    }

    .aeopress-hours-grid input[type="time"] {
        width: 100px;
    }

    .aeopress-settings .nav-tab {
        padding: 8px 10px;
        font-size: 12px;
    }

    .aeopress-settings .nav-tab .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
}

@media screen and (max-width: 600px) {
    .aeopress-settings .nav-tab-wrapper {
        flex-direction: column;
    }

    .aeopress-settings .nav-tab {
        display: flex;
        width: 100%;
        justify-content: center;
        margin-bottom: 2px;
        font-size: 13px;
    }

    .aeopress-settings h1 {
        font-size: 22px;
    }

    .aeopress-welcome-content h3 {
        font-size: 18px;
    }

    .aeopress-hours-grid thead {
        display: none;
    }

    .aeopress-hours-grid tbody tr {
        display: block;
        padding: 10px;
        border-bottom: 1px solid #dcdcde;
    }

    .aeopress-hours-grid tbody td {
        display: block;
        padding: 4px 0;
        border-bottom: none;
    }
}

/* ==========================================================================
   Dark Mode Support (WordPress 5.7+)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .aeopress-info-box {
        background: #1e3a5f;
        border-color: #3582c4;
    }

    .aeopress-info-box strong {
        color: #f0f0f1;
    }

    .aeopress-conflict-warning {
        background: #3d3000;
        border-color: #a88c00;
        color: #f0d98c;
    }

    .aeopress-conflict-warning strong {
        color: #f0d98c;
    }
}
