*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.7);
    --input-bg: rgba(13, 17, 23, 0.5);
    --border-color: rgba(48, 54, 61, 0.6);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;

    /* Modern Gradient Accents */
    --accent: #58a6ff;
    --accent-gradient: linear-gradient(135deg, #58a6ff 0%, #8b5cf6 100%);
    --accent-hover: #1f6feb;
    --accent-glow: rgba(88, 166, 255, 0.4);

    --danger: #da3633;
    --radius: 12px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;

    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(88, 166, 255, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 25%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    padding-bottom: 20px;
    border-bottom: var(--glass-border);
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100px;
    height: 1px;
    background: var(--accent-gradient);
    box-shadow: 0 0 10px var(--accent);
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(90deg, #fff, #a5d6ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo svg {
    color: #58a6ff;
    filter: drop-shadow(0 0 8px rgba(88, 166, 255, 0.5));
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

#auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-username {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

#auth-toggle a {
    color: var(--accent);
    text-decoration: none;
}

#auth-toggle a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn.primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.2);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.3);
}

.btn.primary:active {
    transform: translateY(0);
}

.btn.secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: var(--glass-border);
    color: var(--text-primary);
    backdrop-filter: blur(5px);
}

.btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn.danger {
    background-color: transparent;
    border: 1px solid rgba(218, 54, 51, 0.3);
    color: var(--danger);
}

.btn.danger:hover {
    background-color: rgba(218, 54, 51, 0.1);
    border-color: var(--danger);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.03);
    border: var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Dashboard */
.search-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

input,
select,
textarea {
    background-color: var(--input-bg);
    border: var(--glass-border);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
    background-color: rgba(13, 17, 23, 0.8);
}

.search-bar input {
    flex: 1;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.prompt-card,
.skill-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.prompt-card::before,
.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.prompt-card:hover::before,
.skill-card:hover::before {
    opacity: 1;
}

.prompt-card:hover,
.skill-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(88, 166, 255, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}

.badge {
    background: rgba(88, 166, 255, 0.1);
    color: #79c0ff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(88, 166, 255, 0.2);
    white-space: nowrap;
}

.card-preview {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.6;
}

.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s;
}

.prompt-card:hover .tag,
.skill-card:hover .tag {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
}

/* ──── Card Rating Display ──── */

.card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.card-rating .star {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.15);
}

.card-rating .star.filled {
    color: #f5a623;
}

.card-rating .star.half {
    color: #f5a623;
    opacity: 0.6;
}

.rating-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 2px;
}

/* ──── Fork Count ──── */

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.fork-count {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.fork-count-detail {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ──── Reviews Section ──── */

.reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.reviews-header h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rating-avg {
    font-size: 1rem;
    font-weight: 600;
    color: #f5a623;
}

.rating-none {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Star display (read-only) */
.star {
    color: rgba(255, 255, 255, 0.15);
    font-size: 1rem;
}

.star.filled {
    color: #f5a623;
}

.star.half {
    color: #f5a623;
    opacity: 0.6;
}

.star.empty {
    color: rgba(255, 255, 255, 0.15);
}

/* Interactive star selector */
.review-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: var(--glass-border);
    border-radius: var(--radius);
}

.star-selector {
    display: flex;
    gap: 4px;
    cursor: pointer;
}

.star-btn {
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.2);
    transition: color 0.15s, transform 0.1s;
    user-select: none;
    line-height: 1;
}

.star-btn.hover,
.star-btn.selected {
    color: #f5a623;
}

.star-btn:hover {
    transform: scale(1.15);
}

/* Review items */
.review-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.review-item:last-child {
    border-bottom: none;
}

.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.review-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-author {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.review-stars .star {
    font-size: 0.85rem;
}

.review-date {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.review-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 4px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    background-color: #161b22;
    background-image: linear-gradient(rgba(22, 27, 34, 0.9), rgba(22, 27, 34, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 5vh auto;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 550px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-content.large {
    max-width: 900px;
}

.close-modal {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #fff;
}

.form-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Detail View */
.detail-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-header h2 {
    margin: 0 0 12px 0;
    font-size: 1.8rem;
    color: #fff;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-section {
    margin-bottom: 32px;
}

.detail-section h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.code-block-wrapper {
    position: relative;
    background-color: rgba(13, 17, 23, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.code-block-wrapper:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.code-block-wrapper pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.6;
    color: #e6edf3;
}

.code-block-wrapper .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: all 0.2s;
    background-color: rgba(22, 27, 34, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block-wrapper:hover .copy-btn {
    opacity: 1;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(22, 27, 34, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(20px);
    opacity: 0;
    animation: toast-in 0.3s forwards;
    font-size: 0.9rem;
    font-weight: 500;
}

.toast.success {
    border-left: 3px solid #238636;
}

.toast.error {
    border-left: 3px solid #da3633;
}

@keyframes toast-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* History Items */
.history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Version Control Enhancements */
.version-badge {
    background: var(--accent-gradient);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.card-header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.last-modified {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn.small {
    padding: 4px 12px;
    font-size: 0.8rem;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-item-preview {
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 8px;
}

.history-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Version comparison modal */
pre {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ──── Landing Page ──── */

/* Hero */
.landing-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 120px;
}

.hero-badge {
    display: inline-block;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.2);
    color: #79c0ff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 24px 0;
    color: #fff;
    letter-spacing: -1px;
}

.hero-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 36px 0;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

/* Hero Mockup */
.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-mockup {
    width: 100%;
    max-width: 460px;
    background: rgba(22, 27, 34, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(88, 166, 255, 0.06);
    transform: perspective(800px) rotateY(-2deg) rotateX(1deg);
    transition: transform 0.5s ease;
}

.hero-mockup:hover {
    transform: perspective(800px) rotateY(0deg) rotateX(0deg);
}

.mockup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(13, 17, 23, 0.5);
}

.mockup-dots {
    display: flex;
    gap: 6px;
}

.mockup-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.mockup-dots span:first-child { background: #ff5f57; }
.mockup-dots span:nth-child(2) { background: #febc2e; }
.mockup-dots span:last-child { background: #28c840; }

.mockup-title-bar {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.mockup-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mockup-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.3s;
}

.mockup-card.active {
    border-color: rgba(88, 166, 255, 0.3);
    background: rgba(88, 166, 255, 0.05);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.06);
}

.mockup-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 6px;
}

.mockup-card-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.mockup-card-badge.accent {
    background: rgba(88, 166, 255, 0.12);
    color: #79c0ff;
}

.mockup-card-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.mockup-var {
    color: #d2a8ff;
    font-family: 'SFMono-Regular', Consolas, monospace;
    background: rgba(139, 92, 246, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.7rem;
}

.mockup-version-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-size: 0.65rem;
    color: var(--accent);
    font-weight: 500;
}

/* Features Section */
.landing-features {
    margin-bottom: 120px;
}

.features-header {
    text-align: center;
    margin-bottom: 60px;
}

.features-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
}

.features-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: var(--radius);
    padding: 32px 28px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(88, 166, 255, 0.2);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--accent);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 10px 0;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.feature-card code {
    background: rgba(139, 92, 246, 0.1);
    color: #d2a8ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

/* How It Works */
.landing-how-it-works {
    margin-bottom: 120px;
}

.steps-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.step-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: var(--radius);
    padding: 32px 28px;
    text-align: center;
    flex: 1;
    max-width: 280px;
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 auto 18px auto;
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.25);
}

.step-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px 0;
}

.step-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.step-connector {
    color: rgba(88, 166, 255, 0.3);
    flex-shrink: 0;
}

/* CTA Section */
.landing-cta {
    text-align: center;
    padding: 80px 40px;
    background: rgba(22, 27, 34, 0.6);
    border: var(--glass-border);
    border-radius: 20px;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

.cta-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(88, 166, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.landing-cta h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px 0;
    position: relative;
}

.landing-cta p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    position: relative;
}

.landing-cta .btn {
    position: relative;
}

/* ──── Mobile Responsive Design ──── */

/* Tablet and below */
@media (max-width: 768px) {
    .landing-hero {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 80px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-mockup {
        transform: none;
        max-width: 400px;
        margin: 0 auto;
    }

    .hero-mockup:hover {
        transform: none;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .features-header h2 {
        font-size: 1.6rem;
    }

    .steps-grid {
        flex-direction: column;
        gap: 16px;
    }

    .step-connector {
        transform: rotate(90deg);
    }

    .step-card {
        max-width: 100%;
    }

    .landing-features,
    .landing-how-it-works {
        margin-bottom: 80px;
    }

    .landing-cta {
        padding: 50px 24px;
    }

    .landing-cta h2 {
        font-size: 1.5rem;
    }

    .app-container {
        padding: 20px 12px;
    }

    header {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 30px;
        text-align: center;
    }

    .logo h1 {
        font-size: 1.4rem;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }

    #add-skill-btn {
        width: 100%;
    }

    .search-bar {
        flex-direction: column;
        gap: 12px;
    }

    .search-bar input,
    .search-bar select,
    .search-bar .btn {
        width: 100%;
    }

    .grid-layout {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 4px;
    }

    .prompt-card,
    .skill-card {
        padding: 20px;
    }

    /* Mobile modals */
    .modal-content {
        width: 95%;
        margin: 2vh auto;
        padding: 20px;
        max-height: 95vh;
    }

    .modal-content.large {
        max-width: 95%;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .detail-content {
        flex-direction: column;
    }

    .detail-main,
    .detail-sidebar {
        flex: 1;
        width: 100%;
    }

    .detail-tabs {
        flex-wrap: wrap;
    }

    .tab-button {
        flex: 1;
        min-width: 80px;
    }
}

/* Medium: 2-column features grid before full collapse */
@media (max-width: 768px) and (min-width: 560px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    body {
        font-size: 14px;
    }

    .logo {
        flex-direction: column;
        gap: 8px;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .prompt-card h3,
    .skill-card h3 {
        font-size: 1rem;
    }

    .prompt-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Detail modal title */
    .detail-header h2 {
        font-size: 1.3rem;
    }

    /* Detail modal bottom action buttons — stack into two rows */
    .detail-footer-actions {
        flex-direction: column;
        gap: 10px;
    }

    .detail-footer-actions > div {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        width: 100%;
    }

    .detail-footer-actions > div .btn {
        flex: 1;
        justify-content: center;
    }

    /* Full-screen mobile modals */
    .modal-content {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
        padding: 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content.large {
        max-width: 100%;
    }

    .close-modal {
        position: fixed;
        top: 16px;
        right: 16px;
        background: var(--card-bg);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1001;
    }

    /* Improve touch targets */
    .btn,
    .tab-button,
    input[type="text"],
    input[type="password"],
    select,
    textarea {
        min-height: 44px;
    }

    .prompt-card,
    .skill-card {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.1s;
    }

    .prompt-card:active,
    .skill-card:active {
        transform: scale(0.98);
    }

    /* Optimize form inputs — prevents zoom on iOS */
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    select {
        font-size: 16px;
    }

    /* Bottom safe area for iPhone X+ */
    .app-container {
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }

    /* Toast safe area */
    #toast-container {
        bottom: max(24px, env(safe-area-inset-bottom, 24px));
        right: 16px;
        left: 16px;
    }
}

/* iPhone SE and very small screens */
@media (max-width: 375px) {
    .logo h1 {
        font-size: 1.1rem;
    }

    .prompt-card,
    .skill-card {
        padding: 16px;
    }

    .modal h2 {
        font-size: 1.2rem;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 90vh;
        margin: 5vh auto;
    }

    header {
        flex-direction: row;
        text-align: left;
    }

    .header-actions {
        flex-direction: row;
        width: auto;
    }

    #add-skill-btn {
        width: auto;
    }
}

/* Touch device optimizations */
/* ── Supporting Files ── */

.skill-files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-file-entry {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
}

.skill-file-entry .file-header {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.skill-file-entry .file-header input {
    flex: 1;
}

.skill-file-entry .file-header select {
    width: auto;
    min-width: 120px;
}

.skill-file-entry textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

.skill-file-entry .remove-file-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.2em;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.skill-file-entry .remove-file-btn:hover {
    opacity: 1;
}

.detail-files-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-file-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.detail-file-item .file-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.detail-file-item .file-item-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.detail-file-item .file-item-header .file-name {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9em;
    color: var(--accent);
}

.detail-file-item .file-item-header .file-type-badge {
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent);
}

.detail-file-item .file-item-content {
    display: none;
    padding: 0 14px 14px;
}

.detail-file-item .file-item-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.88em;
    line-height: 1.5;
    color: var(--text-muted);
}

.detail-file-item.expanded .file-item-content {
    display: block;
}

@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .prompt-card:hover,
    .skill-card:hover {
        transform: none;
        box-shadow: var(--glass-shadow);
    }

    .btn:hover {
        transform: none;
    }

    /* Add active states for better feedback */
    .btn:active {
        transform: scale(0.95);
    }

    /* Increase scrollbar size for touch */
    ::-webkit-scrollbar {
        width: 8px;
    }
}