:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body.dark-mode {
    --bg-color: #1f2937;
    --text-color: #f3f4f6;
    --border-color: #374151;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    line-height: 1.6;
}

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

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

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

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.tagline {
    font-size: 12px;
    margin: 5px 0 0 0;
    opacity: 0.9;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    opacity: 0.8;
    text-decoration: underline;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Language Selector */
.language-selector {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-right: 10px;
}

.language-selector:hover {
    background: rgba(255, 255, 255, 0.3);
}

.language-selector:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.language-selector option {
    background: var(--text-color);
    color: var(--bg-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero h2 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: bold;
}

.hero p {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    pointer-events: none;
}

/* Tools Section */
.tools-section {
    padding: 80px 20px;
}

.tools-section h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 60px;
}

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

/* Tool Card */
.tool-card {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
}

.tool-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-icon {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.tool-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.tool-card p {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-color);
    padding: 40px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--danger-color);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

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

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

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

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

/* File Upload */
.file-upload {
    position: relative;
    display: inline-block;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--primary-color);
    border-radius: 5px;
    padding: 40px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.file-upload-label:hover {
    background: rgba(99, 102, 241, 0.05);
}

.file-upload-label i {
    font-size: 32px;
    color: var(--primary-color);
    margin-right: 10px;
}

/* Ad Space */
.ad-space {
    padding: 30px 20px;
    text-align: center;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.adsbygoogle {
    display: inline-block;
    width: 728px;
    height: 90px;
}

/* Output Section */
.output-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 5px;
}

.output-section h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.output-box {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    padding: 15px;
    border-radius: 5px;
    word-break: break-all;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    max-height: 300px;
    overflow-y: auto;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.result-item {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.result-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.result-item img {
    max-width: 100%;
    max-height: 120px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.result-item p {
    font-size: 12px;
    margin: 10px 0 0 0;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    margin-top: 60px;
}

.footer-link {
    color: white;
    text-decoration: underline;
    margin: 0 10px;
}

/* Success/Error Messages */
.message {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
}

.message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.message.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 0;
    }

    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }

    .navbar-brand {
        flex-direction: column;
        gap: 5px;
    }

    .navbar-menu {
        width: 100%;
        justify-content: center;
        gap: 20px;
    }

    .hero h2 {
        font-size: 32px;
    }

    .hero p {
        font-size: 16px;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .tool-card {
        padding: 20px;
    }

    .modal-content {
        padding: 20px;
    }

    .search-box input {
        padding: 12px 40px 12px 15px;
        font-size: 14px;
    }

    .adsbygoogle {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 24px;
    }

    .tools-section h2 {
        font-size: 24px;
    }

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

    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .close-btn {
        align-self: flex-end;
        margin-top: -10px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.gap-10 {
    gap: 10px;
}

.flex {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-between {
    justify-content: space-between;
}

.w-full {
    width: 100%;
}

.max-w-full {
    max-width: 100%;
}

.text-muted {
    opacity: 0.7;
}

.text-small {
    font-size: 12px;
}

.rounded {
    border-radius: 5px;
}
