/**
 * CSS styles for IP Information Service
 */

.hidden { display: none; }

body { 
    font-family: Arial, sans-serif; 
    margin: 0; 
    padding: 20px; 
    transition: background 0.3s, color 0.3s; 
}

body.light { 
    background: #f0f0f0; 
    color: #333; 
}

body.dark { 
    background: #333; 
    color: #f0f0f0; 
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
}

.theme-toggle { 
    position: absolute; 
    top: 20px; 
    right: 20px; 
    padding: 10px; 
    cursor: pointer; 
    background: #4dabf7;
    color: white;
    border: none;
    border-radius: 5px;
}

.theme-toggle:hover {
    background: #3b99e6;
}

h1, h2 { 
    text-align: center; 
    margin: 20px 0;
}

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

.card { 
    background: #fff; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    text-align: center; 
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

body.dark .card { 
    background: #444; 
}

.card i { 
    font-size: 24px; 
    margin-bottom: 10px; 
    color: #4dabf7;
}

.card h3 { 
    margin: 10px 0; 
    font-size: 18px; 
}

.card p { 
    margin: 0; 
    word-break: break-all; 
}

table.alt { 
    width: 100%; 
    border-collapse: collapse; 
    margin: 20px 0;
}

table.alt thead tr { 
    background: #f5f5f5; 
    color: #333; 
}

body.dark table.alt thead tr { 
    background: #444; 
    color: #f0f0f0; 
}

table.alt tbody tr { 
    border-bottom: 1px solid #ddd; 
    cursor: pointer; 
    transition: background 0.2s;
}

body.dark table.alt tbody tr { 
    border-bottom: 1px solid #555; 
}

table.alt tbody tr:hover { 
    background-color: #f0f0f0; 
}

body.dark table.alt tbody tr:hover { 
    background-color: #555; 
}

table.alt td, table.alt th { 
    padding: 12px; 
    text-align: left;
}

.bot-badge { 
    background: #ff6b6b; 
    color: white; 
    padding: 5px 10px; 
    border-radius: 15px; 
    font-size: 12px; 
    margin-left: 10px; 
}

.human-badge { 
    background: #51cf66; 
    color: white; 
    padding: 5px 10px; 
    border-radius: 15px; 
    font-size: 12px; 
    margin-left: 10px; 
}

.hack-badge { 
    background: #ff922b; 
    color: white; 
    padding: 5px 10px; 
    border-radius: 15px; 
    font-size: 12px; 
    margin-left: 10px; 
}

.visitor-type-badge { 
    display: inline-block; 
    padding: 8px 15px; 
    border-radius: 20px; 
    font-size: 14px; 
    font-weight: bold; 
    margin: 10px 0;
}

.bot-type { 
    background: #ff6b6b; 
    color: white; 
}

.human-type { 
    background: #51cf66; 
    color: white; 
}

.hack-type { 
    background: #ff922b; 
    color: white; 
}

.url-list { 
    margin: 20px 0; 
}

.url-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px; 
    border-bottom: 1px solid #ddd; 
    transition: background 0.2s;
}

.url-item:hover {
    background: #f9f9f9;
}

body.dark .url-item { 
    border-bottom: 1px solid #555; 
}

body.dark .url-item:hover {
    background: #444;
}

.url-link { 
    color: inherit; 
    text-decoration: none; 
    flex-grow: 1;
}

.url-link:hover { 
    text-decoration: underline; 
    color: #4dabf7;
}

.url-count { 
    background: #4dabf7; 
    color: white; 
    padding: 4px 10px; 
    border-radius: 10px; 
    font-size: 12px;
    font-weight: bold;
}

.view-details-btn {
    background: #51cf66;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: background 0.2s;
}

.view-details-btn:hover {
    background: #40c057;
}

.security-alert {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 12px;
    margin: 15px 0;
    color: #856404;
}

body.dark .security-alert {
    background: #444;
    border: 1px solid #666;
    color: #ffd43b;
}

.security-alert i {
    margin-right: 8px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .theme-toggle {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    table.alt {
        font-size: 14px;
    }
    
    table.alt td, table.alt th {
        padding: 8px 4px;
    }
    
    .url-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Animation for loading */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, table.alt tbody tr, .url-item {
    animation: fadeIn 0.3s ease-out;
}

/* Language selector */
.language-selector {
    text-align: center;
    margin: 20px 0;
}

.language-selector form {
    display: inline-block;
}

.language-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

body.dark .language-selector select {
    background: #444;
    color: white;
    border-color: #666;
}

.language-selector select:focus {
    outline: none;
    border-color: #4dabf7;
}

/* RTL language selector adjustments */
[dir="rtl"] .language-selector {
    text-align: center;
}