/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #202124;
    background-color: #fafafa;
}

.container {
    /*max-width: 1200px;*/
    max-width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header Styles */
.header {
    background: #fff;
    box-shadow: 0 1px 6px rgba(32,33,36,.28);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #dadce0;
}

.navbar {
    padding: 16px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: 500;
    color: #1a73e8;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-dropdown {
    position: relative;
}

.nav-link {
    color: #5f6368;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 24px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.nav-link:hover {
    background-color: #f1f3f4;
    color: #202124;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 4px 6px rgba(32,33,36,.28);
    border-radius: 8px;
    padding: 8px 0;
    border: 1px solid #dadce0;
}

.nav-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    color: #202124;
    text-decoration: none;
    transition: background-color 0.2s;
    font-size: 14px;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 50%, #34a853 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

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

.hero h1 {
    font-size: 48px;
    margin-bottom: 16px;
    font-weight: 400;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.9;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Tools Grid */
.tools-grid {
    padding: 64px 0;
    background: #fff;
}

.tool-category {
    margin-bottom: 48px;
}

.tool-category h2 {
    font-size: 32px;
    margin-bottom: 32px;
    color: #202124;
    font-weight: 400;
    position: relative;
    padding-bottom: 16px;
}

.tool-category h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #1a73e8, #4285f4);
    border-radius: 2px;
}

.tools-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.tool-card {
    background: white;
    border: 1px solid #dadce0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1a73e8, #4285f4, #34a853, #fbbc04, #ea4335);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(32,33,36,.28);
    border-color: #1a73e8;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card h3 {
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 500;
}

.tool-card h3 a {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.2s;
}

.tool-card h3 a:hover {
    color: #1557b0;
}

.tool-card p {
    color: #5f6368;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== CLEAN GLOBAL TOOL DESIGN ===== */

/* Tool Page Layout */
.main.tool-page {
    padding: 40px 0;
    background: #f8f9fa;
    min-height: calc(100vh - 140px);
}

/* Tool Header - Clean and Minimal */
.tool-header {
    text-align: center;
    margin-bottom: 40px;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(32,33,36,.08);
}

.tool-icon {
    margin-bottom: 16px;
}

.tool-header h1 {
    font-size: 32px;
    color: #202124;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.tool-header p {
    font-size: 16px;
    color: #5f6368;
    margin: 0 0 24px 0;
}

.tool-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 14px;
    color: #5f6368;
}

.stat-item strong {
    color: #1a73e8;
    font-weight: 500;
}

/* Tool Interface - Focus on Functionality */
.tool-interface {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(32,33,36,.08);
    margin-bottom: 32px;
}

.interface-header {
    text-align: center;
    margin-bottom: 32px;
}

.interface-header h2 {
    font-size: 24px;
    color: #202124;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.interface-header p {
    font-size: 14px;
    color: #5f6368;
    margin: 0;
}

/* Input/Output Sections */
.input-section,
.output-section {
    margin-bottom: 24px;
}

.input-group,
.output-group {
    position: relative;
}

label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 500;
    color: #202124;
    font-size: 16px;
}

label svg {
    color: #1a73e8;
}

/* Global Textarea Design */
textarea {
    width: 100%;
    min-height: 140px;
    padding: 20px;
    border: 2px solid #e8eaed;
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: white;
    color: #202124;
    box-sizing: border-box;
    outline: none;
}

textarea:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,.1);
}

textarea::placeholder {
    color: #9aa0a6;
}

/* Output Textarea */
.output-group textarea {
    background: #f8f9fa;
    padding-right: 60px;
}

/* Conversion/Sort Buttons */
.conversion-buttons,
.sorting-options {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.conversion-buttons h3,
.sorting-options h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #202124;
    font-size: 18px;
    font-weight: 500;
}

.btn-grid,
.sort-type-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.conversion-btn,
.sort-type-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border: 2px solid #e8eaed;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: inherit;
    width: 100%;
}

.conversion-btn:hover,
.sort-type-btn:hover {
    border-color: #1a73e8;
    box-shadow: 0 4px 12px rgba(26,115,232,.15);
    transform: translateY(-2px);
}

.conversion-btn.active,
.sort-type-btn.active {
    border-color: #1a73e8;
    background: #f8f9ff;
}

.btn-icon {
    font-size: 24px;
    min-width: 40px;
    text-align: center;
    color: #1a73e8;
    font-weight: bold;
}

.btn-content {
    flex: 1;
}

.btn-title {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 4px;
}

.btn-desc {
    display: block;
    font-size: 14px;
    color: #5f6368;
}

/* Stats and Counters */
.char-count,
.input-stats,
.output-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #5f6368;
}

.char-count {
    justify-content: flex-end;
}

/* Remove excessive content sections */
.content-section {
    display: none;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover {
    background-color: #f1f3f4;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: #5f6368;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 1px;
}

/* Mobile Menu Animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(32,33,36,.28);
        border-top: 1px solid #dadce0;
        flex-direction: column;
        padding: 16px 0;
        z-index: 1000;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-link {
        padding: 16px 24px;
        border-radius: 0;
        border-bottom: 1px solid #f1f3f4;
        font-size: 16px;
        display: block;
        width: 100%;
    }
    
    .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: #f8f9fa;
        margin: 0;
        padding: 0;
    }
    
    .nav-dropdown.active .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        padding: 12px 48px;
        font-size: 14px;
        border-bottom: 1px solid #e8eaed;
    }
    
    .dropdown-content a:last-child {
        border-bottom: none;
    }
    
    /* Override hover behavior on mobile */
    .nav-dropdown:hover .dropdown-content {
        display: none;
    }
}

/* Tablet styles */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-menu {
        gap: 4px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .dropdown-content {
        min-width: 200px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-header {
        padding: 24px;
    }
    
    .tool-interface {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .stat-item {
        font-size: 12px;
    }
    
    .tool-stats {
        gap: 16px;
    }
    
    textarea {
        min-height: 120px;
        padding: 16px;
    }
    
    .copy-btn {
        position: static;
        margin-top: 12px;
        width: 100%;
        justify-content: center;
    }
}

/* Footer Styles */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #dadce0;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h3 {
    color: #202124;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 500;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #5f6368;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: #1a73e8;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #dadce0;
    color: #5f6368;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .tools-row {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .nav-menu {
        display: none;
    }
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeInUp 0.6s ease forwards;
}

.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }
.tool-card:nth-child(5) { animation-delay: 0.5s; }
.tool-card:nth-child(6) { animation-delay: 0.6s; }

/* Action Buttons - Clean Design */
.action-buttons {
    display: flex;
    gap: 16px;
    margin: 24px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 48px;
    justify-content: center;
}

.btn-primary {
    background: #1a73e8;
    color: white;
    box-shadow: 0 2px 8px rgba(26,115,232,.3);
}

.btn-primary:hover {
    background: #1557b0;
    box-shadow: 0 4px 12px rgba(26,115,232,.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: white;
    color: #5f6368;
    border: 2px solid #e8eaed;
    box-shadow: 0 1px 3px rgba(60,64,67,.1);
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    color: #202124;
    transform: translateY(-1px);
}

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.copy-btn:hover {
    background: #1557b0;
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: #34a853;
}

.copy-success {
    display: none;
}

.copy-btn.copied .copy-text {
    display: none;
}

.copy-btn.copied .copy-success {
    display: inline;
}

/* QR Code Generator Styles */
.tool-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 32px;
}

.input-section {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(32,33,36,.1);
    border: 1px solid #dadce0;
}

.output-section {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(32,33,36,.1);
    border: 1px solid #dadce0;
    text-align: center;
}

.customization-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #dadce0;
}

.customization-section h3 {
    margin-bottom: 16px;
    color: #202124;
    font-size: 18px;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.color-input {
    height: 50px;
    padding: 4px;
    border-radius: 8px;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    border: 2px dashed #dadce0;
    border-radius: 12px;
    color: #5f6368;
}

.preview-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

#qr-preview img {
    max-width: 100%;
    height: auto;
}

#download-section {
    margin-top: 20px;
}

@media (max-width: 768px) {
    .tool-wrapper {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}