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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --bg-color: #f8f9fa;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 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 */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
}

.header-top {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}


.language-switcher {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.lang-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.lang-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
}

.header-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.header-title-logo {
    width: 240px;
    height: 240px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

header h1 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: 700;
    flex: 1;
    min-width: 300px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    padding: 40px 20px;
}

.tool-section {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.settings-group {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.setting-item {
    flex: 1;
    min-width: 200px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.select-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.select-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#keyword-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: border-color 0.3s;
}

#keyword-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

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

.btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #ecf0f1;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #d5dbdb;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Loading Modal */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.loading-modal.hidden {
    display: none;
}

.loading-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.loading-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    z-index: 10000;
    animation: slideUp 0.3s ease-out;
}

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

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.loading-text-wrapper p {
    margin-bottom: 10px;
}

.progress-bar-wrapper {
    margin-top: 20px;
    position: relative;
}

.progress-bar,
div.progress-bar,
.loading-modal-content .progress-bar {
    width: 100% !important;
    height: 24px !important;
    background: linear-gradient(90deg, #e0e7ff 0%, #ddd6fe 100%) !important;
    background-image: linear-gradient(90deg, #e0e7ff 0%, #ddd6fe 100%) !important;
    border-radius: 12px !important;
    overflow: visible !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
    position: relative !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    background-color: transparent !important;
    -webkit-background-size: 100% 100% !important;
    background-size: 100% 100% !important;
}

#progress.progress-fill,
.progress-fill,
div#progress,
.loading-modal-content .progress-fill,
.loading-modal-content #progress {
    height: 100% !important;
    background: linear-gradient(90deg, #4ade80 0%, #3b82f6 50%, #8b5cf6 100%) !important;
    background-image: linear-gradient(90deg, #4ade80 0%, #3b82f6 50%, #8b5cf6 100%) !important;
    border-radius: 8px !important;
    transition: width 0.3s ease !important;
    width: 0% !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4) !important;
    animation: progress-glow 2s ease-in-out infinite !important;
    -webkit-animation: progress-glow 2s ease-in-out infinite !important;
    -webkit-background-size: 100% 100% !important;
    background-size: 100% 100% !important;
    background-color: transparent !important;
}

@keyframes progress-glow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 2px 12px rgba(59, 130, 246, 0.6);
    }
}

.progress-hedgehog {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%) scaleX(-1);
    font-size: 40px;
    transition: left 0.3s ease;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: hedgehog-walk 0.5s ease-in-out infinite;
    line-height: 1;
}

@keyframes hedgehog-walk {
    0%, 100% {
        transform: translate(-50%, -50%) scaleX(-1) rotate(0deg);
    }
    25% {
        transform: translate(-50%, -55%) scaleX(-1) rotate(5deg);
    }
    75% {
        transform: translate(-50%, -45%) scaleX(-1) rotate(-5deg);
    }
}


/* Results */
.results-section {
    margin-top: 30px;
}

.results-section.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filters {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    flex-wrap: wrap;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.filter-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
}

.filter-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

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

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

tbody tr:hover {
    background-color: #f8f9fa;
}

.keyword-cell {
    font-weight: 500;
}

.paa-badge {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 8px;
    cursor: help;
}

.question-badge {
    display: inline-block;
    background-color: #f39c12;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 8px;
}

.copy-btn {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.copy-btn:hover {
    background-color: #229954;
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Content Section */
.content-section {
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: var(--shadow);
    line-height: 1.8;
}

.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2rem;
}

.content-section h3 {
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.content-section p {
    margin-bottom: 15px;
}

.content-section ul, .content-section ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.content-section li {
    margin-bottom: 10px;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
}

footer p {
    margin-bottom: 10px;
    opacity: 0.9;
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Czujowski Footer */
footer.czujowski-footer {
    background: transparent;
    padding: 2rem 1rem;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

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

footer.czujowski-footer .czujowski-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    justify-content: center;
    width: auto;
    max-width: 100%;
}

footer.czujowski-footer .czujowski-footer-brand > a {
    display: flex;
    align-items: center;
}

footer.czujowski-footer .czujowski-footer-brand-text {
    display: inline-flex;
    align-items: center;
    width: auto;
}

footer.czujowski-footer .czujowski-footer-logo {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

footer.czujowski-footer .czujowski-footer-logo:hover {
    transform: scale(1.1);
}

footer.czujowski-footer .czujowski-footer-brand-name {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4ade80 0%, #3b82f6 50%, #4ade80 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1.2;
    display: block;
    white-space: nowrap;
    animation: czujowski-gradient-shift 3s ease-in-out infinite;
}

@keyframes czujowski-gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

footer.czujowski-footer .czujowski-footer-brand-name:hover {
    animation-duration: 1.5s;
    filter: brightness(1.2);
}

@media (max-width: 767px) {
    .loading-modal-content {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .progress-bar {
        height: 20px;
    }
    
    footer.czujowski-footer {
        padding: 1.5rem 0.5rem;
        gap: 0.75rem;
    }

    footer.czujowski-footer .czujowski-footer-logo {
        width: 18px;
        height: 18px;
    }

    footer.czujowski-footer .czujowski-footer-brand-name {
        font-size: 1rem;
    }

    footer.czujowski-footer .czujowski-footer-brand {
        gap: 0.5rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-top {
        position: static;
        justify-content: center;
        margin-bottom: 15px;
    }

    header {
        padding: 30px 0;
    }

    .header-title-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    header h1 {
        font-size: 1.8rem;
        text-align: center;
    }

    .header-title-logo {
        width: 180px;
        height: 180px;
    }

    .loading-logo {
        width: 180px;
        height: 180px;
    }

    .progress-hedgehog {
        font-size: 32px;
    }

    .progress-bar {
        height: 20px;
    }

    .input-wrapper {
        flex-direction: column;
    }

    #keyword-input, .btn-primary {
        width: 100%;
    }

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

    .setting-item {
        width: 100%;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-actions {
        width: 100%;
    }

    .btn-secondary {
        flex: 1;
    }

    .content-section {
        padding: 20px;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 8px;
    }
}

