* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 50px;
    padding: 40px 20px;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.tool-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #667eea;
}

.tool-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
}

.difficulty {
    color: #ffa500;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    color: white;
    padding: 20px;
    opacity: 0.9;
}

/* Tool Pages Styles */
.tool-page {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 900px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.tool-page h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.tool-page .description {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.input-section, .output-section {
    margin-bottom: 30px;
}

.input-section h3, .output-section h3 {
    margin-bottom: 10px;
    color: #333;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
    font-weight: 500;
}

button:hover {
    background: #5568d3;
}

button:active {
    transform: scale(0.98);
}

button.secondary {
    background: #6c757d;
}

button.secondary:hover {
    background: #5a6268;
}

.stats {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.stats p {
    margin: 5px 0;
    color: #666;
}

.options {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.option-item {
    margin-bottom: 15px;
}

.option-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #333;
}

.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.option-item input[type="text"] {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    max-width: 400px;
}

.option-item input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .tool-page {
        padding: 20px;
    }
}
