/* ==========================================================================
   Dashboard Widget Styles
   ========================================================================== */

#adsterra_dashboard_widget {
    font-size: inherit;
}

#adsterra_dashboard_widget #container-box {
    background-color: transparent;
}

#adsterra_dashboard_widget #containerChartjs {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    margin-bottom: 12px;
}

#adsterra_dashboard_widget .adsterra-controls {
    background: white;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

#adsterra_dashboard_widget .adsterra-controls table {
    width: 100%;
    border-collapse: collapse;
}

#adsterra_dashboard_widget .adsterra-controls td {
    padding: 3px;
    vertical-align: middle;
    font-size: 12px;
}

#adsterra_dashboard_widget .adsterra-controls select {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.3s;
    width: 100%;
}

#adsterra_dashboard_widget .adsterra-controls select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

#adsterra_dashboard_widget .inside .small-box h3,
#adsterra_dashboard_widget .inside .small-md-6 h3 {
    font-size: 0.75em;
    color: #666;
    padding: 0;
    margin: 0 0 4px 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

#adsterra_dashboard_widget .inside .small-box p,
#adsterra_dashboard_widget .inside .small-md-6 p {
    font-size: 1.2em;
    margin: 0;
    font-weight: 700;
    color: #2c3e50;
}

#adsterra_dashboard_widget .inside .small-box {
    background: white;
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

#adsterra_dashboard_widget .inside .small-box:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#adsterra_dashboard_widget .inside .small-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

#adsterra_dashboard_widget .inside .small-box.small-md-6 {
    grid-column: 1 / -1;
}

#adsterra_dashboard_widget .inside .small-box.small-md-6:before {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

#adsterra_dashboard_widget .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    clear: both;
}

/* Refresh button animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.dashicons.spin {
    animation: spin 1s linear infinite;
}

#adsterra_refresh_cache {
    white-space: nowrap;
    font-size: 12px;
    padding: 4px 10px;
    height: auto;
}

#adsterra_refresh_cache .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

#adsterra_refresh_cache:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Widget error message styling */
#adsterra_dashboard_widget .error.notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
}

#adsterra_dashboard_widget .error.notice p {
    margin: 0;
    color: #856404;
}

/* Clear floats */
#adsterra_dashboard_widget .stats-grid:after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   Settings Page Styles
   ========================================================================== */

.adsterra-settings-wrap {
    max-width: 1000px;
    margin: 20px 0;
}

.adsterra-settings-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.adsterra-settings-header h1 {
    margin: 0 0 10px 0;
    color: white;
    font-size: 28px;
    font-weight: 600;
}

.adsterra-settings-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.adsterra-settings-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    padding: 30px;
}

.adsterra-form-group {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.adsterra-form-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.adsterra-form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #23282d;
    font-size: 14px;
}

.adsterra-form-input {
    width: 100%;
    max-width: 500px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.adsterra-form-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.adsterra-form-select {
    width: 100%;
    max-width: 500px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.3s;
}

.adsterra-form-select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.adsterra-toggle-wrapper {
    display: flex;
    align-items: center;
}

.adsterra-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.adsterra-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.adsterra-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.adsterra-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.adsterra-toggle input:checked + .adsterra-toggle-slider {
    background-color: #667eea;
}

.adsterra-toggle input:checked + .adsterra-toggle-slider:before {
    transform: translateX(24px);
}

.adsterra-toggle-label {
    margin-left: 12px;
    color: #666;
    font-size: 14px;
}

.adsterra-description {
    margin-top: 8px;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.adsterra-description a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.adsterra-description a:hover {
    text-decoration: underline;
}

.adsterra-submit-wrapper {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.adsterra-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.adsterra-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.adsterra-alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.adsterra-alert-error {
    background-color: #fee;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.adsterra-alert-icon {
    margin-right: 10px;
    font-size: 18px;
}

/* ==========================================================================
   Responsive Improvements
   ========================================================================== */

@media screen and (max-width: 782px) {
    #adsterra_dashboard_widget .adsterra-controls table,
    #adsterra_dashboard_widget .adsterra-controls tbody,
    #adsterra_dashboard_widget .adsterra-controls tr,
    #adsterra_dashboard_widget .adsterra-controls td {
        display: block;
        width: 100%;
    }

    #adsterra_dashboard_widget .adsterra-controls td {
        padding: 4px 0;
        text-align: left;
    }

    #adsterra_dashboard_widget .stats-grid {
        grid-template-columns: 1fr;
    }

    .adsterra-settings-header {
        padding: 20px;
    }

    .adsterra-settings-header h1 {
        font-size: 22px;
    }

    .adsterra-settings-card {
        padding: 20px;
    }

    .adsterra-form-input,
    .adsterra-form-select {
        max-width: 100%;
    }
}
