:root {
    --bg-color: #f4f7f9;
    --card-bg-color: #ffffff;
    --text-color: #333;
    --muted-text-color: #6c757d;
    --primary-color: #6a5acd;
    --primary-hover-color: #5a4ab9;
    --border-color: #e0e6ed;
    --input-bg-color: #ffffff;
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    --card-radius: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    background-image: linear-gradient(170deg, #f4f7f9 0%, #e8eef2 100%);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 2rem;
    min-height: 100vh;
}

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

.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.app-header p {
    font-size: 1.1rem;
    color: var(--muted-text-color);
    max-width: 600px;
    margin: 0 auto;
}

.content-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.form-column {
    flex: 1 1 40%;
    position: sticky;
    top: 2rem;
}

.results-column {
    flex: 1 1 60%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

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

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--input-bg-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(106, 90, 205, 0.2);
}

textarea {
    resize: vertical;
}

button[type="submit"],
.secondary-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
}

button[type="submit"] {
    background-image: linear-gradient(to right, #6a5acd 0%, #8a7ae0 51%, #6a5acd 100%);
    background-size: 200% auto;
    color: white;
    transition: 0.5s;
}

button[type="submit"]:hover {
    background-position: right center;
    transform: scale(1.02);
}

button:disabled {
    background-color: #a0c7e4;
    cursor: not-allowed;
}

.secondary-btn {
    background-color: #6c757d;
    color: white;
    margin-top: 1rem;
}
.secondary-btn:hover {
    background-color: #5a6268;
}
.secondary-btn:disabled {
    background-color: #b0b5b9;
}


#results h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 2rem;
}

.result-item {
    margin-bottom: 1.5rem;
}

#results input,
#results textarea {
    background-color: var(--input-bg-color);
    cursor: copy;
}

#ghost-actions hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

#ghost-actions h3 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.blog-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-message {
    text-align: center;
    margin-top: 1rem;
    font-weight: 500;
    height: 1em;
}
.status-message.success { color: #28a745; }
.status-message.error { color: #dc3545; }

/* Loading States */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--muted-text-color);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-left-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* Responsive Design */
@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }
    .form-column {
        position: static;
        width: 100%;
    }
}

@media (max-width: 576px) {
    body {
        padding: 1rem;
    }
    .card {
        padding: 1.5rem;
    }
    .app-header h1 {
        font-size: 2rem;
    }
}

/* Tooltip for copy-to-clipboard */
.copied-tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    z-index: 100;
    opacity: 0;
    animation: fade-in-out 1.5s;
}

@keyframes fade-in-out {
    0% { opacity: 0; transform: translateY(-5px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-5px); }
}

/* Notification System */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 320px;
}

.notification {
    background-color: #fff;
    color: #333;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-left: 5px solid;
}

.notification.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.notification.is-leaving {
    opacity: 0;
    transform: translateX(120%);
}

.notification.is-success {
    border-left-color: #4CAF50;
}

.notification.is-error {
    border-left-color: #f44336;
}

/* Dark Mode */
body.dark-mode {
    --bg-color: #1a1a2e;
    --card-bg-color: #162447;
    --text-color: #e0e6ed;
    --muted-text-color: #a0a0a0;
    --border-color: #2a3b5f;
    --input-bg-color: #1e3a5f;
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

body.dark-mode body {
    background-image: linear-gradient(170deg, #1a1a2e 0%, #162447 100%);
}

body.dark-mode .card {
    border: 1px solid var(--border-color);
}

body.dark-mode input[type="text"],
body.dark-mode textarea,
body.dark-mode select {
    background-color: var(--input-bg-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

body.dark-mode #results input,
body.dark-mode #results textarea {
    background-color: var(--input-bg-color);
}

/* Theme switcher */
.theme-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
    gap: 0.5rem;
}

#theme-toggle {
    appearance: none;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

#theme-toggle::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

#theme-toggle:checked {
    background-color: var(--primary-color);
}

#theme-toggle:checked::before {
    transform: translateX(20px);
}
