/**
 * All of the CSS for your admin-specific functionality should be
 * included in this file.
 */

/* Happy Ads Admin Layout */
.happy-ads-admin-container {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
}

.happy-ads-main-settings {
    flex: 1;
    min-width: 600px;
    margin-right: 20px;
}

.happy-ads-sidebar {
    width: 350px;
}

/* Section Styling */
.happy-ads-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin-bottom: 20px;
    padding: 15px 20px;
}

.happy-ads-section h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.happy-ads-section h3 {
    margin: 1.5em 0 0.5em;
}

/* Form elements */
.happy-ads-section p {
    margin: 0 0 15px;
}

.happy-ads-field {
    margin-bottom: 15px;
}

.happy-ads-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.happy-ads-field input[type="text"],
.happy-ads-field input[type="password"] {
    width: 100%;
    max-width: 400px;
}

.happy-ads-field .description {
    color: #666;
    font-style: italic;
    margin-top: 4px;
    font-size: 13px;
    display: block;
}

.happy-ads-tracking-options {
    margin-top: 15px;
}

.happy-ads-tracking-options label {
    display: block;
    margin-bottom: 10px;
}

/* Status Indicators */
.happy-ads-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: normal;
}

.happy-ads-status-success {
    background: #d4f4e2;
    color: #0a6b39;
}

.happy-ads-status-warning {
    background: #f8dda7;
    color: #94660c;
}

.happy-ads-status-error {
    background: #f8d7da;
    color: #d63638;
}

.happy-ads-sync-status {
    margin-bottom: 20px;
}

.happy-ads-sync-options {
    margin: 10px 0 15px;
}

/* Results and Notices */
.happy-ads-result {
    margin: 10px 0;
    padding: 8px 12px;
    display: none;
}

.happy-ads-result.notice-success,
.happy-ads-result.notice-error {
    display: block;
}

.notice-success {
    background: #d4f4e2;
    border-left: 4px solid #0a6b39;
}

.notice-error {
    background: #f8d7da;
    border-left: 4px solid #d63638;
}

.happy-ads-connection-result {
    margin-left: 10px;
    padding: 5px 10px;
    display: inline-block;
}

/* Welcome Message */
.happy-ads-welcome-message {
    background: #f8f9fa;
    border-left: 4px solid #2271b1;
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 2px;
}

.happy-ads-welcome-message h3 {
    margin-top: 0;
    color: #2271b1;
}

/* Button Styling */
.happy-ads-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.happy-ads-sync-button {
    min-width: 120px;
    text-align: center;
}

/* Spinners and Loaders */
.happy-ads-sync-spinner,
#happy_ads_verify_connection_spinner,
#happy_ads_reset_webhooks_spinner {
    float: none;
    margin-left: 5px;
    vertical-align: middle;
}

/* Header */
.happy-ads-header {
    margin: 15px 0 25px;
}

.happy-ads-header h1 {
    color: #23282d;
    display: inline-block;
    margin-right: 15px;
}

.happy-ads-api-credentials {
    margin-top: 10px;
}

/* Responsive Layout */
@media screen and (max-width: 1100px) {
    .happy-ads-main-settings,
    .happy-ads-sidebar {
        width: 100%;
        min-width: 0;
        margin-right: 0;
    }

    .happy-ads-buttons {
        flex-direction: column;
    }

    .happy-ads-sync-button {
        width: 100%;
    }
}

.happy-ads-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Button styles */
.happy-ads-copy-button,
.happy-ads-toggle-password {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    height: 30px;
    min-width: 30px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.happy-ads-copy-button:hover,
.happy-ads-toggle-password:hover {
    background: #f0f0f1;
    border-color: #50575e;
}

.happy-ads-copy-button .dashicons,
.happy-ads-toggle-password .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.happy-ads-toggle-password {
    padding: 0;
    width: 30px;
}

.happy-ads-toggle-password .dashicons {
    margin: 0;
}

/* Input field adjustments */
.happy-ads-input-group input[type="text"],
.happy-ads-input-group input[type="password"] {
    height: 30px;
    min-height: 30px;
}

.woocommerce-api-link {
    margin-top: 10px;
    color: #646970;
}

.woocommerce-api-link a {
    text-decoration: none;
}

.woocommerce-api-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
}