/**
 * Agent System Pro
 * Filename: common.css
 * Version: 1.0
 * Folder: /plugins/agentsystempro/assets/css/
 * Description: Common styles for all pages
 * Developer: Jim Tjernstroem
 * Copyright: Vianke Ltd Jim Tjernstroem 2025
 */

/* Reset and Base Styles */
.asp-page * {
    box-sizing: border-box;
}

.asp-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333333;
}

/* Container */
.asp-wrapper {
    min-height: 100vh;
    background-color: #f5f5f5;
}

/* Typography */
.asp-page h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 20px 0;
}

.asp-page h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 15px 0;
}

.asp-page h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 10px 0;
}

.asp-page p {
    margin: 0 0 15px 0;
}

/* Forms */
.asp-form-group {
    margin-bottom: 20px;
}

.asp-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #4a4a4a;
}

.asp-form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.asp-form-control:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.asp-form-control[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.asp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.asp-form-checkbox label {
    display: flex;
    align-items: center;
    font-weight: normal;
}

.asp-form-checkbox input[type="checkbox"] {
    margin-right: 8px;
}

select.asp-form-control {
    cursor: pointer;
}

textarea.asp-form-control {
    resize: vertical;
    min-height: 100px;
}

.asp-form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

/* Buttons */
.asp-btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1.5;
}

.asp-btn:hover {
    text-decoration: none;
}

.asp-btn-primary {
    background-color: #007cba;
    color: #ffffff;
    border-color: #007cba;
}

.asp-btn-primary:hover {
    background-color: #005a87;
    border-color: #005a87;
    color: #ffffff;
}

.asp-btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

.asp-btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: #ffffff;
}

.asp-btn-success {
    background-color: #28a745;
    color: #ffffff;
    border-color: #28a745;
}

.asp-btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: #ffffff;
}

.asp-btn-danger {
    background-color: #dc3545;
    color: #ffffff;
    border-color: #dc3545;
}

.asp-btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: #ffffff;
}

.asp-btn-block {
    display: block;
    width: 100%;
}

.asp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Alerts */
.asp-alert {
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.asp-alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.asp-alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.asp-alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffecc7;
}

.asp-alert-info {
    color: #004085;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Tables */
.asp-table {
    width: 100%;
    background-color: #ffffff;
    border-collapse: collapse;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.asp-table th,
.asp-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.asp-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #4a4a4a;
}

.asp-table tbody tr:hover {
    background-color: #f8f9fa;
}

.asp-table tbody tr:last-child td {
    border-bottom: none;
}

/* Cards */
.asp-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.asp-card-header {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.asp-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Loading */
.asp-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: asp-spin 1s linear infinite;
}

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

/* Utilities */
.asp-text-center {
    text-align: center;
}

.asp-text-right {
    text-align: right;
}

.asp-text-muted {
    color: #6c757d;
}

.asp-mt-10 {
    margin-top: 10px;
}

.asp-mt-20 {
    margin-top: 20px;
}

.asp-mb-10 {
    margin-bottom: 10px;
}

.asp-mb-20 {
    margin-bottom: 20px;
}

.asp-p-10 {
    padding: 10px;
}

.asp-p-20 {
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .asp-form-row {
        grid-template-columns: 1fr;
    }
    
    .asp-table {
        font-size: 12px;
    }
    
    .asp-table th,
    .asp-table td {
        padding: 8px 10px;
    }
}

/* WordPress Admin Bar Fix */
.admin-bar .asp-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .asp-header {
        top: 46px;
    }
}

/* Hide WordPress Admin Bar for non-admins */
.asp-page:not(.asp-role-admin) #wpadminbar {
    display: none !important;
}

.asp-page:not(.asp-role-admin) {
    margin-top: 0 !important;
}
