/* Base Styles and Variables */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --background: #0f172a;
    --foreground: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --success: #22c55e;
    --error: #ef4444;
    --radius: 0.5rem;
    --transition: all 0.2s ease-in-out;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    max-width: 48rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Enhanced Header Styles for WordPress */
.header.wp-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 1rem;
    background: linear-gradient(to bottom, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.9));
    border-radius: var(--radius);
}

.header__title.wp-heading {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header__subtitle.wp-subheading {
    font-size: 1.5rem;
    opacity: 0.95;
    color: #ffffff !important;
    display: inline-block;
    margin-left: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.header__hero.wp-hero-section {
    max-width: 42rem;
    margin: 2rem auto 0;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header__description.wp-description {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #ffffff !important;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Main Card */
.main-card.wp-content {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Social Media Selector */
.social-selector {
    margin-bottom: 1.5rem;
}

.social-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.social-button.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.social-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary) !important;
}

/* Input Styles */
.text-input,
.select-input,
.textarea-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.textarea-input {
    min-height: 100px;
    resize: vertical;
}

/* Enhanced Button Groups for WordPress */
.button-group {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
}

.button-group.variations {
    grid-template-columns: repeat(3, 1fr);
}

.length-button,
.variation-button {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--card-bg);
    color: var(--text-primary) !important;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.length-button.active,
.variation-button.active {
    background-color: var(--primary);
    color: #ffffff !important;
    border-color: var(--primary);
}

/* Enhanced Toggle Switch for WordPress */
.toggle-container {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    padding: 0.5rem;
    background-color: rgba(37, 99, 235, 0.05);
    border-radius: var(--radius);
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    color: var(--text-primary) !important;
}

.toggle-switch {
    position: relative;
    width: 3.5rem;
    height: 1.75rem;
    background-color: #e2e8f0;
    border-radius: 999px;
    margin-right: 0.75rem;
    transition: var(--transition);
}

.toggle-switch::after {
    content: "";
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="checkbox"]:checked + .toggle-switch {
    background-color: var(--primary);
}

input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(1.75rem);
}

.toggle-text {
    font-weight: 500;
    margin-left: 0.5rem;
    color: var(--text-primary) !important;
}

/* Generate Button */
.generate-button {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.125rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.generate-button:hover {
    background-color: var(--primary-hover);
}

.generate-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Generated Comments Section */
.generated-comments {
    margin-bottom: 2rem;
}

.comment-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.comment-stats {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
}

.comment-content {
    margin: 1.5rem 0;
    font-size: 1.125rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.comment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.comment-navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-button {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
}

.nav-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.chevron {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.comment-counter {
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-width: 4rem;
    text-align: center;
}

.copy-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
}

.copy-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Animation */
.loading::after {
    content: "...";
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { content: "." }
    33% { content: ".." }
    66% { content: "..." }
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .header__title {
        font-size: 2rem;
    }

    .header__subtitle {
        font-size: 1.25rem;
    }

    .main-card {
        padding: 1rem;
    }

    .button-group {
        gap: 0.5rem;
    }

    .length-button,
    .variation-button {
        padding: 0.5rem;
    }
}