/**
 * artistpro Security - Professional Light Mode Admin CSS
 * Consistent styling for all admin pages
 */

/* Main container */
.artistpro-security-page {
    background: #ffffff;
    color: #111827;
    padding: 20px;
    margin: 20px 0 0 -20px;
}

/* Cards */
.artistpro-card,
.ip-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.artistpro-card h2,
.ip-card h2 {
    color: #111827;
    font-size: 20px;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #0284C7;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tables */
.ip-table,
.artistpro-table {
    width: 100%;
    border-collapse: collapse;
    background: #f9fafb;
    border-radius: 8px;
    overflow: hidden;
}

.ip-table thead th,
.artistpro-table thead th {
    background: #f3f4f6;
    color: #111827;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #0284C7;
}

.ip-table tbody td,
.artistpro-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
}

.ip-table tbody tr:hover,
.artistpro-table tbody tr:hover {
    background: #f3f4f6;
}

/* Forms */
.form-table th,
.form-table td {
    padding: 12px 0;
    color: #111827;
}

.form-table th {
    font-weight: 600;
    padding-right: 20px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb !important;
    color: #111827 !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: #0284C7 !important;
    outline: none !important;
    box-shadow: 0 0 0 1px #0284C7 !important;
}

/* Buttons */
.button,
.button-primary,
.button-secondary {
    background: #0284C7 !important;
    border-color: #0284C7 !important;
    color: #fff !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-weight: 500 !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.button:hover,
.button-primary:hover {
    background: #5568d3 !important;
    border-color: #5568d3 !important;
    transform: translateY(-1px);
}

.button-secondary {
    background: #3a3a3a !important;
    border-color: #e5e7eb !important;
}

.button-secondary:hover {
    background: #4a4a4a !important;
}

.button-small {
    padding: 4px 12px !important;
    font-size: 13px !important;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: #84CC16; color: #fff; }
.badge-danger { background: #ef4444; color: #fff; }
.badge-warning { background: #f59e0b; color: #fff; }
.badge-secondary { background: #6b7280; color: #fff; }

/* Status indicators */
.status-active { color: #84CC16; font-weight: 600; }
.status-inactive { color: #ef4444; font-weight: 600; }

/* Notices */
.notice {
    background: #f9fafb;
    border-left: 4px solid #0284C7;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
}

.notice-success {
    border-left-color: #84CC16;
    background: rgba(34, 197, 94, 0.1);
}

.notice-warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.notice-error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.notice-info {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

/* Code blocks */
code {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 2px 6px;
    border-radius: 3px;
    color: #0284C7;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

/* Toggle switches */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3a3a3a;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #0284C7;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Activity list */
.activity-item {
    padding: 12px;
    border-left: 3px solid #0284C7;
    margin-bottom: 12px;
    background: #f9fafb;
    border-radius: 4px;
}

.activity-item.blocked {
    border-left-color: #ef4444;
}

.activity-item.success {
    border-left-color: #84CC16;
}

/* Protection status grid */
.protection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.protection-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.protection-item h3 {
    margin: 0 0 8px 0;
    color: #111827;
    font-size: 16px;
}

.protection-item .status {
    font-size: 14px;
    color: #84CC16;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 782px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .protection-grid {
        grid-template-columns: 1fr;
    }
}

/* Override WordPress defaults */
.wrap {
    color: #111827;
}

.wrap h1 {
    color: #111827;
}

/* License page specific */
#license_key {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    font-size: 16px;
}

/* Settings sections */
.settings-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e5e7eb;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h2 {
    color: #111827;
    font-size: 18px;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #0284C7;
}

.settings-description {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ========================================
   Country Blocking - Professional Layout
   ======================================== */

/* Main country page wrapper */
.artistpro-security-country-blocking {
    background: #ffffff;
    color: #111827;
}

/* Country stats bar */
.country-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.country-stats .stat {
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    padding: 24px;
    border-radius: 8px;
    text-align: center;
}

.country-stats .stat .number {
    color: #ffffff; /* White numbers on purple gradient */
    font-size: 48px;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

.country-stats .stat .number.success {
    color: #84CC16;
}

.country-stats .stat .number.warning {
    color: #f59e0b;
}

.country-stats .stat .label {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Country blocking grid */
.country-blocking-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    margin-top: 24px;
}

/* Quick actions card */
.quick-actions-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    height: fit-content;
}

.quick-actions-card h3 {
    color: #111827;
    font-size: 18px;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #0284C7;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.quick-actions .button {
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
    height: auto;
    padding: 12px 16px !important;
}

.quick-actions .button small {
    display: block;
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.8;
    font-weight: normal;
}

/* Country list card */
.country-list-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
}

.country-list-card h3 {
    color: #111827;
    font-size: 18px;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #0284C7;
}

/* Country search */
.country-search {
    margin-bottom: 20px;
}

.country-search input {
    width: 100%;
    padding: 12px 16px !important;
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    color: #111827 !important;
    font-size: 15px !important;
}

.country-search input:focus {
    border-color: #0284C7 !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
}

/* Country list */
.country-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom scrollbar */
.country-list::-webkit-scrollbar {
    width: 8px;
}

.country-list::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.country-list::-webkit-scrollbar-thumb {
    background: #0284C7;
    border-radius: 4px;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Country groups (A-Z) */
.country-group {
    margin-bottom: 24px;
}

.country-group h4 {
    color: #0284C7;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px 0;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    border-left: 4px solid #0284C7;
}

.country-group .countries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

/* Individual country item */
.country-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.country-item:hover {
    background: #252525;
    border-color: #0284C7;
    transform: translateX(4px);
}

.country-item.blocked {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.country-item.blocked:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Checkbox styling */
.country-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0 12px 0 0;
    cursor: pointer;
    flex-shrink: 0;
}

/* Flag emoji */
.country-item .country-flag {
    font-size: 32px;
    margin-right: 12px;
    flex-shrink: 0;
    line-height: 1;
}

/* Country name */
.country-item .country-name {
    color: #111827;
    font-size: 15px;
    font-weight: 500;
    flex-grow: 1;
}

.country-item.blocked .country-name {
    color: #fca5a5;
}

/* Country code */
.country-item .country-code {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* Blocked stats card */
.blocked-stats-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.blocked-stats-card h3 {
    color: #111827;
    font-size: 18px;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #0284C7;
}

.blocked-countries-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blocked-country-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.blocked-country-bar .country-code {
    width: 40px;
    font-weight: 600;
    color: #111827;
}

.blocked-country-bar .bar {
    flex-grow: 1;
    height: 32px;
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.blocked-country-bar .count {
    width: 60px;
    text-align: right;
    color: #111827;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1200px) {
    .country-blocking-grid {
        grid-template-columns: 1fr;
    }

    .country-group .countries {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 782px) {
    .country-stats {
        grid-template-columns: 1fr;
    }

    .country-group .countries {
        grid-template-columns: 1fr;
    }

    .country-item .country-flag {
        font-size: 28px;
    }

    .country-item .country-name {
        font-size: 14px;
    }
}

/* Security Logs - Filter Alignment */
.artistpro-security-logs .tablenav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.artistpro-security-logs .filters-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 400px;
}

.artistpro-security-logs .filters-form select,
.artistpro-security-logs .filters-form input[type="text"] {
    height: 36px !important;
    padding: 6px 12px !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 150px;
}

.artistpro-security-logs .filters-form input[type="text"] {
    min-width: 180px;
}

.artistpro-security-logs .filters-form input[type="hidden"] {
    display: none;
}

.artistpro-security-logs .filters-form .button {
    height: 36px !important;
    padding: 0 16px !important;
    margin: 0 !important;
    white-space: nowrap;
}

.artistpro-security-logs .tablenav-pages {
    display: flex;
    align-items: center;
    margin: 0;
}

.artistpro-security-logs .tablenav-pages .displaying-num {
    color: #111827;
    font-size: 14px;
    font-weight: 500;
}

.artistpro-security-logs .log-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.artistpro-security-logs .log-actions .button {
    height: 36px !important;
    padding: 0 16px !important;
    margin: 0 !important;
    white-space: nowrap;
}

/* Make sure logs table has proper spacing */
.artistpro-security-logs .wp-list-table {
    margin-top: 0;
    background: #ffffff;
}

/* Responsive: stack on smaller screens */
@media (max-width: 1200px) {
    .artistpro-security-logs .tablenav {
        flex-direction: column;
        align-items: stretch;
    }
    
    .artistpro-security-logs .filters-form,
    .artistpro-security-logs .tablenav-pages,
    .artistpro-security-logs .log-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
