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

:root {
    --primary-color: #4a90e2;
    --primary-dark-color: #357abd;
    --primary-hover-color: #3a7bc8;
    --secondary-color: #f39c12;
    --text-color: #333;
    --muted-text-color: #666;
    --subtle-text-color: #555;
    --placeholder-text-color: #999;
    --bg-color: #f5f5f5;
    --white: #ffffff;
    --border-color: #ddd;
    --strength-bar-bg: #ddd;
    --btn-secondary-bg: #6c757d;
    --btn-secondary-hover-bg: #5a6268;
    --status-active-bg: #d4edda;
    --status-active-text: #155724;
    --status-planned-bg: #fff3cd;
    --status-planned-text: #856404;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-focus: 0 0 0 3px rgba(74, 144, 226, 0.1);
    --shadow-button-hover: 0 4px 8px rgba(0, 0, 0, 0.2);
    --shadow-consent: 0 -4px 12px rgba(0, 0, 0, 0.12);
    --ad-bg: #f0f0f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

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

/* Header Styles */
.site-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.site-logo {
    width: 36px;
    height: 36px;
    display: inline-block;
    flex-shrink: 0;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.site-nav a:hover {
    color: var(--primary-color);
}

.lang-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--white);
    color: var(--text-color);
    font-size: 0.95rem;
}

/* Ad Container Styles */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem auto;
    background-color: var(--ad-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.ad-placeholder {
    min-height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.adsbygoogle-slot {
    display: inline-block;
}

.adsbygoogle-slot--top-banner,
.adsbygoogle-slot--in-content,
.adsbygoogle-slot--bottom-banner {
    width: 728px;
    height: 90px;
}

.adsbygoogle-slot--sidebar-1,
.adsbygoogle-slot--sidebar-2 {
    width: 300px;
    height: 250px;
}

/* Demo ad placeholder styling - Remove in production */
.ad-demo {
    padding: 1rem;
    color: var(--placeholder-text-color);
    font-size: 0.875rem;
    text-align: center;
}

/* Top Banner Ad */
.ad-top-banner {
    max-width: 728px;
    height: 90px;
    margin-top: 1rem;
}

/* Bottom Banner Ad */
.ad-bottom-banner {
    max-width: 728px;
    height: 90px;
    margin: 2rem auto;
}

/* Main Wrapper */
.main-wrapper {
    padding: 2rem 0;
}

/* Homepage Styles */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark-color) 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tool-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.tool-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: var(--muted-text-color);
    line-height: 1.6;
}

.tool-card-disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.tool-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.status-active {
    background: var(--status-active-bg);
    color: var(--status-active-text);
}

.status-planned {
    background: var(--status-planned-bg);
    color: var(--status-planned-text);
}

.section-about {
    margin-top: 3rem;
}

/* Content Grid Layout */
.content-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

/* Sidebar Styles */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ad-sidebar {
    width: 300px;
    height: 250px;
}

.sidebar-section {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.sidebar-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.tool-list {
    list-style: none;
}

.tool-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.tool-list li:last-child {
    border-bottom: none;
}

.tool-list a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.tool-list a:hover {
    color: var(--primary-color);
}

/* Main Content Styles */
.main-content {
    min-height: 600px;
}

.tool-container {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.tool-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.tool-description {
    margin-bottom: 2rem;
    color: var(--muted-text-color);
    font-size: 1.1rem;
}

/* Tool Interface Styles */
.tool-interface {
    margin-bottom: 2rem;
}

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

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-focus);
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-button-hover);
}

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

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

/* In-Content Ad */
.ad-in-content {
    max-width: 728px;
    height: 90px;
    margin: 2rem auto;
}

/* Tool Info Styles */
.tool-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.tool-info h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.tool-info ul,
.tool-info ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.tool-info li {
    margin-bottom: 0.5rem;
}

.tool-info-compact {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Password Tool Styles */
.input-range {
    width: 100%;
    cursor: pointer;
}

.password-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.password-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.password-output {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: bold;
}

.strength-bar {
    height: 10px;
    background: var(--strength-bar-bg);
    border-radius: 5px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.strength-fill {
    width: 100%;
    height: 100%;
    border: 0;
    appearance: none;
    display: block;
}

.strength-fill::-webkit-progress-bar {
    background: transparent;
}

.strength-fill::-webkit-progress-value {
    transition: all 0.3s ease;
    background: var(--primary-color);
}

.strength-fill::-moz-progress-bar {
    transition: all 0.3s ease;
    background: var(--primary-color);
}

.strength-fill.strength-weak::-webkit-progress-value,
.strength-fill.strength-weak::-moz-progress-bar,
.strength-text.strength-weak {
    background: #dc3545;
    color: #dc3545;
}

.strength-fill.strength-medium::-webkit-progress-value,
.strength-fill.strength-medium::-moz-progress-bar,
.strength-text.strength-medium {
    background: #ffc107;
    color: #ffc107;
}

.strength-fill.strength-strong::-webkit-progress-value,
.strength-fill.strength-strong::-moz-progress-bar,
.strength-text.strength-strong {
    background: #28a745;
    color: #28a745;
}

.strength-text {
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Footer Styles */
.site-footer {
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    padding: 2rem 0 1rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

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

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--muted-text-color);
    font-size: 0.875rem;
}

/* Consent Banner */
.consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-consent);
    z-index: 1000;
}

.consent-banner .consent-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.consent-banner .consent-text {
    margin: 0;
    color: var(--subtle-text-color);
    flex: 1 1 auto;
}

.consent-banner .consent-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.consent-banner .consent-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.consent-banner .consent-link:hover {
    text-decoration: underline;
}

.consent-banner-visible {
    padding-bottom: 96px;
}

.clipboard-helper {
    position: fixed;
    left: -999999px;
    top: 0;
    opacity: 0;
    pointer-events: none;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    color: var(--white);
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
    cursor: pointer;
}

.toast--success {
    background-color: #28a745;
}

.toast--error {
    background-color: #dc3545;
}

.toast--info {
    background-color: #17a2b8;
}

.toast--warning {
    background-color: #ffc107;
    color: var(--text-color);
}

.toast--hiding {
    animation: slideOut 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.color-preview {
    height: 80px;
    padding: 0;
    display: block;
}

/* Responsive Design */
@media (max-width: 968px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .main-content {
        order: 1;
    }

    .ad-sidebar {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-actions {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .lang-select {
        width: 100%;
        max-width: 220px;
    }

    .site-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tool-container {
        padding: 1.5rem;
    }

    .tool-title {
        font-size: 1.5rem;
    }

    /* Stack buttons on small screens */
    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    /* Smaller ad sizes on mobile */
    .ad-top-banner,
    .ad-bottom-banner,
    .ad-in-content {
        max-width: 320px;
        height: 100px;
    }

    .adsbygoogle-slot--top-banner,
    .adsbygoogle-slot--in-content,
    .adsbygoogle-slot--bottom-banner {
        width: 320px;
        height: 100px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .consent-banner .consent-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .consent-banner .consent-actions {
        width: 100%;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none;
}
