/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007BFF;
    --secondary-color: #17A2B8;
    --accent-color: #28A745;
    --dark-bg: #6C757D;
    --medium-bg: #495057;
    --light-bg: #f8f9fa;
    --text-dark: #212529;
    --text-light: #6C757D;
    --border-color: #dee2e6;
    --success: #28A745;
    --error: #dc3545;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Header */
header {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 1.25rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h1 i {
    color: #FFD700;
    font-size: 1.3rem;
}

.tagline {
    font-size: 0.75rem;
    opacity: 0.85;
    display: none;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
}

.main-nav a i {
    font-size: 0.9rem;
}

.main-nav a:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.main-nav a.active {
    background: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 50%, #e9ecef 100%);
    padding: 2.5rem 0;
    text-align: center;
    position: relative;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 50px;
    border: 3px solid var(--secondary-color);
    box-shadow: 0 10px 25px rgba(23, 162, 184, 0.15);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(23, 162, 184, 0.25);
}

.search-icon {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 0.5rem 0;
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: var(--text-dark);
}

.search-box input::placeholder {
    color: var(--text-light);
}

.search-box button {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.search-box button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(23, 162, 184, 0.4);
}

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

/* Tools Section */
.tools-section {
    padding: 1.5rem 0;
}

.tools-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 0.4rem;
}

.tools-section h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 1px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.65rem;
}

.tool-card {
    background: white;
    padding: 0.85rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.2);
    border-color: var(--secondary-color);
}

.tool-icon {
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
    color: white;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    box-shadow: 0 4px 10px rgba(23, 162, 184, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 15px rgba(23, 162, 184, 0.4);
}

.tool-icon i {
    display: block;
}

/* Encoding tools - Teal/Blue gradient */
#encoding .tool-icon {
    background: linear-gradient(135deg, #17A2B8, #007BFF);
}

/* Conversion tools - Green/Teal gradient */
#conversion .tool-icon {
    background: linear-gradient(135deg, #28A745, #17A2B8);
}

/* Utility tools - Purple/Blue gradient */
#utilities .tool-icon {
    background: linear-gradient(135deg, #6f42c1, #007BFF);
}

.tool-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-dark);
}

.tool-card p {
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.3;
}

/* Tool Page Layout */
.tool-page {
    flex: 1;
    padding: 2rem 0;
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
}

.tool-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.tool-header p {
    font-size: 1.05rem;
    color: var(--text-light);
}

.tool-container {
    background: white;
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
}

.form-group textarea,
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s ease;
    resize: vertical;
}

.form-group textarea {
    min-height: 120px;
}

.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.button-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success);
    color: white;
}

.info-box {
    background: #ffffff;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.info-box h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--secondary-color);
}

.color-preview {
    width: 100%;
    height: 80px;
    border-radius: 4px;
    border: 2px solid var(--secondary-color);
    margin-top: 0.75rem;
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

/* Footer */
footer {
    background: var(--dark-bg);
    color: white;
    padding: 1rem 0;
    margin-top: auto;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

footer p {
    font-size: 0.85rem;
}

.footer-nav {
    display: flex;
    gap: 1rem;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 1.3rem;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .main-nav {
        gap: 0.4rem;
    }

    .tool-container {
        padding: 1rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .search-box {
        flex-direction: column;
    }

    .search-box button {
        width: 100%;
    }

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

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

.tool-card {
    animation: fadeIn 0.3s ease-out;
}

/* Alert Messages */
.alert {
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    display: none;
}

.alert.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

