:root {
    --primary-blue: #013d7a;
    --secondary-blue: #0066cc;
    --accent-pink: #ff3366;
    --light-bg: #f0f7ff;
    --card-bg: #ffffff;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e1e8f0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --footer-bg: #0a192f;
    --footer-text: #ccd6f6;
    --footer-heading: #e6f1ff;
    --footer-border: #233554;
    --footer-hover: #64ffda;
    --accent-green: #2ecc71;
    --error: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f7ff 0%, #e4edf5 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-dark);
}

.header {
    background: white;
    position: sticky;
    top: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo a {
    text-decoration: none;
    color: var(--footer-bg);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.logo a:hover {
    color: var(--accent-pink);
}

.nav-links {
    display: flex;
    margin-left: 30px;
}

.nav-item {
    position: relative;
    color: black;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 10px 16px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.links a {
    color: black;
    text-decoration: none;
    transition: all 0.3s ease;
}

.links a:hover {
    color: var(--accent-pink);
}

.nav-item:hover {
    color: var(--accent-pink);
}

.dropdown-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-item:hover .dropdown-icon {
    transform: rotate(180deg);
}

.mega-dropdown {
    position: absolute;
    top: 45px;
    left: -750px;
    background-color: white;
    width: 1200px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 30px;
    display: none;
    z-index: 1001;
    grid-template-columns: repeat(6, 1fr);
    border-top: 3px solid var(--accent-pink);
}

.nav-item:hover .mega-dropdown {
    display: grid;
    animation: fadeIn 0.3s ease;
}

.dropdown-section h3 {
    color: var(--primary-blue);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.dropdown-section h3 i {
    margin-right: 10px;
    color: var(--accent-pink);
    background: rgba(255, 51, 102, 0.1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dropdown-link {
    display: flex;
    align-items: center;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.7rem;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.dropdown-link:hover {
    background-color: #f0f7ff;
    color: var(--accent-pink);
}

.dropdown-link i {
    margin-right: 12px;
    color: var(--secondary-blue);
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.mobile-toggle {
    margin-left: auto;
    display: none;
    background: none;
    border: none;
    color: var(--accent-pink);
    font-size: 24px;
    cursor: pointer;
}

.mobile-sidebar {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: white;
    z-index: 999;
    transition: all 0.4s ease;
    overflow-y: auto;
    padding: 20px;
    box-shadow: var(--shadow);
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-category {
    margin-top: 20px;
}

.mobile-category-title {
    font-size: 18px;
    color: var(--primary-blue);
    font-weight: 500;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-pink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-category-title i {
    color: var(--accent-pink);
}

.mobile-tool-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    transition: all 0.2s;
    background: #f8fafd;
    color: var(--text-dark);
}

.mobile-tool-link:hover {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    transform: translateX(5px);
    color: var(--accent-pink);
}

.mobile-tool-link i {
    margin-right: 15px;
    color: var(--secondary-blue);
    font-size: 18px;
    width: 24px;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    max-width: 1000px;
    width: 100%;
    margin: 40px auto 200px;
    padding: 0 20px;
    gap: 25px;
}

.converter-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s;
}

.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-header h1 {
    display: flex;
    color: var(--footer-bg);
    margin-bottom: 15px;
    align-items: center;
    font-size: 2.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.tool-header p {
    opacity: 0.9;
    max-width: 900px;
}

.tool-body {
    padding: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.input-group label {
    font-weight: 500;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group textarea {
    width: 100%;
    min-height: 150px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--card-bg);
    color: var(--text-dark);
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.char-count {
    text-align: right;
    font-size: 14px;
    color: var(--text-light);
}

.controls {
    display: flex;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: #e1e8f0;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #d1d8e0;
    transform: translateY(-2px);
}

.btn-accent {
    background: var(--accent-pink);
    color: white;
}

.btn-accent:hover {
    background: #e62e5c;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--accent-green);
    color: white;
}

.btn-success:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.result-container {
    margin-top: 30px;
    position: relative;
}

.result-container h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--primary-blue);
}

.result-box {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 20px;
    min-height: 150px;
    border: 1px dashed var(--border-color);
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 16px;
    line-height: 1.8;
}

.result-actions {
    position: absolute;
    top: 5px;
    right: 10px;
    display: flex;
    gap: 8px;
}

.copyright {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 20px;
    text-align: center;
    margin-top: auto;
}

.copyright p {
    margin: 5px 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
    }
    70% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.pulse {
    animation: pulse 0.5s ease;
}

.shake {
    animation: shake 0.5s ease;
}

.success {
    color: var(--accent-green);
}

.error {
    color: var(--error);
}

@media (max-width: 1024px) {
    .mega-dropdown {
        width: 700px;
        grid-template-columns: repeat(3, 1fr);
    }
    .main-content {
        grid-template-columns: 1fr;
    }
    .ascii-table-card {
        margin-top: 30px;
    }
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
    }
    .mobile-toggle {
        display: block;
    }
    .mega-dropdown {
        width: 500px;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        height: 70px;
    }
    .logo a {
        font-size: 22px;
    }
    .mobile-sidebar {
        top: 70px;
        height: calc(100vh - 70px);
    }
    .tool-header h1 {
        font-size: 1.8rem;
    }
    .controls {
        flex-direction: column;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tool-body {
        padding: 20px;
    }
    .tool-header {
        padding: 20px;
    }
    .ascii-table {
        grid-template-columns: repeat(4, 1fr);
    }
}