* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(to right, #3498db, #2c3e50);
    color: white;
    text-align: center;
    padding: 25px 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.description {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    padding: 30px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

input {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.2rem;
    outline: none;
    transition: border-color 0.3s;
}

input:focus {
    border-color: #3498db;
}

button {
    padding: 15px 25px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.secondary-btn {
    background: #2ecc71;
}

.secondary-btn:hover {
    background: #27ae60;
}

.danger-btn {
    background: #e74c3c;
}

.danger-btn:hover {
    background: #c0392b;
}

.result-section {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background: #f8f9fa;
    margin-bottom: 30px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.result {
    font-size: 2rem;
    font-weight: bold;
    margin: 15px 0;
    transition: color 0.3s;
}

.prime {
    color: #27ae60;
}

.not-prime {
    color: #e74c3c;
}

.factors {
    margin-top: 15px;
    font-size: 1.2rem;
}

.history-section {
    margin-top: 30px;
}

h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.history-item:last-child {
    border-bottom: none;
}

.prime-history {
    color: #27ae60;
    font-weight: bold;
}

.info-section {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.info-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.info-text {
    flex: 1;
    min-width: 300px;
}

.info-content h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.info-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.examples {
    flex: 1;
    min-width: 300px;
}

.example-list {
    list-style-type: none;
}

.example-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #ccc;
}

footer {
    text-align: center;
    padding: 20px;
    background: #2c3e50;
    color: white;
}

@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
    }
    
    input {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}