/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
    padding: 15px;
    line-height: 1.5;
    transition: background 0.3s, color 0.3s;
}

body.light-theme {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #334155;
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* Шапка */
header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(148, 163, 184, 0.2);
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.light-theme h1 {
    color: #2563eb;
}

.subtitle {
    font-size: 0.95rem;
    color: #94a3b8;
    max-width: 500px;
    margin: 0 auto;
}

.light-theme .subtitle {
    color: #64748b;
}

/* Блок с IP */
.ip-section {
    margin: 20px 0;
}

.ip-display {
    text-align: center;
    padding: 25px 15px;
    background: rgba(30, 41, 59, 0.7);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.light-theme .ip-display {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(203, 213, 225, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.ip-display:hover {
    transform: translateY(-2px);
}

.ip-label {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 10px;
    font-weight: 500;
}

.light-theme .ip-label {
    color: #64748b;
}

.ip-address {
    font-size: 2.2rem;
    font-weight: 800;
    color: #60a5fa;
    text-shadow: 0 0 15px rgba(96, 165, 250, 0.4);
    letter-spacing: 1px;
    word-break: break-all;
    margin: 15px 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.light-theme .ip-address {
    color: #2563eb;
    text-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

.ip-type {
    font-size: 1rem;
    color: #86efac;
    margin-bottom: 20px;
    font-weight: 500;
}

.light-theme .ip-type {
    color: #16a34a;
}

/* Кнопка копирования */
.copy-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.copy-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
}

.copy-button:active {
    transform: translateY(0);
}

/* Уведомление о копировании */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

/* Сетка с информацией */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.info-card {
    background: rgba(30, 41, 59, 0.7);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 90px;
}

.light-theme .info-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(203, 213, 225, 0.5);
}

.info-card:hover {
    transform: translateY(-2px);
    border-color: #60a5fa;
}

.info-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(96, 165, 250, 0.1);
}

.light-theme .info-icon {
    background: rgba(37, 99, 235, 0.1);
}

.info-content {
    flex: 1;
    min-width: 0;
}

.info-label {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.light-theme .info-label {
    color: #64748b;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    word-break: break-word;
}

.light-theme .info-value {
    color: #334155;
}

/* Секция User Agent */
.user-agent-section {
    background: rgba(30, 41, 59, 0.7);
    border-radius: 12px;
    padding: 18px;
    margin: 20px 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.light-theme .user-agent-section {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(203, 213, 225, 0.5);
}

.section-title {
    font-size: 1.1rem;
    color: #60a5fa;
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-agent-value {
    font-size: 0.85rem;
    color: #cbd5e1;
    word-break: break-all;
    line-height: 1.5;
    max-height: 80px;
    overflow-y: auto;
    padding-right: 5px;
}

.light-theme .user-agent-value {
    color: #475569;
}

/* Панель управления */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 25px 0;
    flex-wrap: wrap;
}

.refresh-button, .theme-toggle {
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
}

.refresh-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.refresh-button:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.refresh-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.theme-toggle {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.theme-toggle:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

/* Подвал */
footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    color: #94a3b8;
    font-size: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.light-theme footer {
    color: #64748b;
}

.footer-note {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 5px;
}

.light-theme .footer-note {
    color: #94a3b8;
}

/* Мини-уведомления */
.mini-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

/* Анимации */
@keyframes highlight {
    0% { 
        background-color: rgba(96, 165, 250, 0.3);
        transform: scale(1);
    }
    50% { 
        background-color: rgba(96, 165, 250, 0.6);
        transform: scale(1.02);
    }
    100% { 
        background-color: transparent;
        transform: scale(1);
    }
}

.highlight-update {
    animation: highlight 1s ease;
    border-radius: 4px;
    padding: 2px 4px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.refresh-button:disabled {
    animation: pulse 1.5s infinite;
    opacity: 0.8;
}

/* Анимация появления элементов */
.ip-display,
.info-grid,
.user-agent-section,
.controls {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-card {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 0.5s ease forwards;
}

/* Задержка анимации для карточек */
.info-card:nth-child(1) { animation-delay: 0.1s; }
.info-card:nth-child(2) { animation-delay: 0.2s; }
.info-card:nth-child(3) { animation-delay: 0.3s; }
.info-card:nth-child(4) { animation-delay: 0.4s; }
.info-card:nth-child(5) { animation-delay: 0.5s; }
.info-card:nth-child(6) { animation-delay: 0.6s; }
.info-card:nth-child(7) { animation-delay: 0.7s; }
.info-card:nth-child(8) { animation-delay: 0.8s; }

/* Скроллбар */
.user-agent-value::-webkit-scrollbar {
    width: 6px;
}

.user-agent-value::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.1);
    border-radius: 3px;
}

.user-agent-value::-webkit-scrollbar-thumb {
    background: #60a5fa;
    border-radius: 3px;
}

.light-theme .user-agent-value::-webkit-scrollbar-thumb {
    background: #2563eb;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .ip-address {
        font-size: 1.8rem;
        min-height: 50px;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .info-card {
        padding: 15px;
        min-height: 80px;
    }
    
    .info-icon {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    .user-agent-value {
        max-height: 60px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .refresh-button, .theme-toggle {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.4rem;
    }
    
    .ip-address {
        font-size: 1.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .info-card {
        min-height: 70px;
    }
    
    .info-icon {
        width: 30px;
        height: 30px;
        font-size: 1.3rem;
    }
    
    .info-value {
        font-size: 0.95rem;
    }
    
    .refresh-button, .theme-toggle {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

@media (max-height: 700px) {
    .ip-address {
        font-size: 1.8rem;
        margin: 10px 0;
    }
    
    .info-grid {
        margin: 15px 0;
        gap: 10px;
    }
    
    .info-card {
        padding: 12px;
        min-height: 65px;
    }
    
    .user-agent-section {
        margin: 15px 0;
        padding: 15px;
    }
    
    .user-agent-value {
        max-height: 50px;
        font-size: 0.8rem;
    }
    
    .controls {
        margin: 15px 0;
    }
}