* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

h1 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

input, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
}

.checkbox input {
    width: auto;
    margin: 0;
}

.add-contact {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.add-contact input {
    flex: 1;
    margin: 0;
}

.add-contact button, .btn-refresh {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.add-contact button:hover, .btn-refresh:hover {
    background: #218838;
    transform: translateY(-1px);
}

.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.contacts-header h3 {
    color: #555;
}

.btn-refresh {
    background: #17a2b8;
    padding: 6px 15px;
    font-size: 12px;
}

.btn-refresh:hover {
    background: #138496;
}

.contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.contact-item:hover {
    background: #f9f9f9;
}

.contact-info {
    flex: 1;
}

.contact-phone {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.contact-name {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.delete-btn:hover {
    background: #c82333;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.progress {
    margin-top: 20px;
}

.progress-bar-container {
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    height: 30px;
}

.progress-bar {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.result-item {
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    font-size: 14px;
}

.result-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.result-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.result-message {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-box {
    flex: 1;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.empty {
    text-align: center;
    padding: 20px;
    color: #999;
}

@media (max-width: 600px) {
    .add-contact {
        flex-direction: column;
    }
    
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 16px;
    }
    
    .stats {
        flex-direction: column;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}