/* Variable Definitions */
:root {
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    /* Pink 500 */
    --bg-color: #f3f4f6;
    /* Gray 100 */
    --text-color: #111827;
    /* Gray 900 */
    --text-muted: #6b7280;
    /* Gray 500 */
    --card-bg: rgba(255, 255, 255, 0.8);
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-md: 0.375rem;
    --radius-lg: 0.75rem;

    --transition: all 0.2s ease-in-out;
}

/* Reset & Base */
* {
    box-sizing: border_box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    text-decoration: none;
}

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

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

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

.btn--secondary:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

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

.btn--icon {
    padding: 0.5rem;
    border-radius: 50%;
}

.input {
    display: block;
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition);
}

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

/* Login Page */
.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-card__title {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-card__subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.auth-form .form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.auth-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-form button {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 1rem;
    z-index: 10;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.prompt-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.prompt-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.prompt-card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--bg-color);
}

/* Compare View */
.prompt-card__images {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.prompt-card__image-container {
    flex: 1;
    position: relative;
    border-right: 1px solid var(--border-color);
}

.prompt-card__image-container:last-child {
    border-right: none;
}

.image-label {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    pointer-events: none;
}

.prompt-card__content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.prompt-card__tags {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag {
    font-size: 0.75rem;
    color: var(--primary-color);
    background: rgba(111, 76, 255, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.prompt-card__text {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.prompt-card__meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge--free {
    background-color: #d1fae5;
    color: #065f46;
}

.badge--paid {
    background-color: #fee2e2;
    color: #991b1b;
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--success-color);
}

input:checked+.slider:before {
    transform: translateX(16px);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal__content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal__content {
    transform: scale(1);
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal__title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal__close:hover {
    color: var(--text-color);
}

.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
}

.fab:hover {
    transform: scale(1.1);
    background-color: var(--primary-hover);
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .dashboard-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .dashboard-header__actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
}