/* ============================================================================
   INSPIRATION CARD STYLES - IMPROVED MOBILE-FRIENDLY VERSION
   ============================================================================ */

.inspiration-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 25px;
    margin-top: 25px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    color: white;
    animation: fadeIn 0.5s ease-out;
}

.inspiration-header {
    text-align: center;
    margin-bottom: 25px;
}

.inspiration-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.3;
}

.inspiration-subtitle {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.5;
}

/* ============================================================================
   INSPIRATION OPTIONS GRID - IMPROVED TOUCH TARGETS
   ============================================================================ */

.inspiration-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.inspiration-option {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 90px; /* Better touch target */
}

.inspiration-option:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.inspiration-option:active {
    transform: translateY(-1px);
}

.option-icon {
    font-size: 40px;
    flex-shrink: 0;
    line-height: 1;
}

.option-content {
    flex: 1;
}

.option-content h4 {
    font-size: 17px;
    margin-bottom: 5px;
    font-weight: 600;
    line-height: 1.3;
}

.option-content p {
    font-size: 14px;
    opacity: 0.85;
    margin: 0;
    line-height: 1.5;
}

/* ============================================================================
   INSPIRATION RESULT STYLES - IMPROVED
   ============================================================================ */

.inspiration-result {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    color: #333;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.inspiration-loading {
    text-align: center;
    font-size: 18px;
    padding: 20px;
    color: #667eea;
    font-weight: 500;
}

.inspiration-content {
    position: relative;
}

.inspiration-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.inspiration-emoji {
    font-size: 32px;
    line-height: 1;
}

.inspiration-title {
    font-size: 22px;
    color: #667eea;
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

.inspiration-text {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 15px;
    font-weight: 400;
}

.inspiration-author {
    font-style: italic;
    color: #666;
    margin-top: 12px;
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.5;
}

.inspiration-date {
    font-size: 14px;
    color: #999;
    margin-top: 8px;
}

.inspiration-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.inspiration-btn {
    background: linear-gradient(135deg, #f1b37e 0%, #eaad6b 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    min-height: 48px; /* Touch-friendly */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.inspiration-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.inspiration-error {
    text-align: center;
    color: #e74c3c;
    font-size: 16px;
    padding: 20px;
    font-weight: 500;
    line-height: 1.6;
}

/* ============================================================================
   SPEAKER BUTTON STYLES - IMPROVED
   ============================================================================ */

.speaker-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    min-height: 52px; /* Better touch target */
}

.speaker-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.speaker-btn.speaking {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.7);
    }
}

/* ============================================================================
   ONBOARDING CARD ENHANCEMENTS - IMPROVED
   ============================================================================ */

.onboarding-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 3px solid transparent;
}

.onboarding-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.onboarding-card:active {
    transform: translateY(-2px);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1;
}

.onboarding-card h3 {
    color: #333;
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.onboarding-card p {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.card-features {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.card-features li {
    padding: 8px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.onboarding-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    min-height: 52px; /* Touch-friendly */
}

.onboarding-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

/* ============================================================================
   RESPONSIVE DESIGN - TABLETS
   ============================================================================ */

@media (max-width: 768px) {
    .inspiration-card {
        padding: 20px;
        margin-top: 20px;
        border-radius: 15px;
    }

    .inspiration-header h2 {
        font-size: 24px;
    }

    .inspiration-subtitle {
        font-size: 14px;
    }

    .inspiration-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .inspiration-option {
        padding: 16px;
        min-height: 80px;
    }

    .option-icon {
        font-size: 36px;
    }

    .option-content h4 {
        font-size: 16px;
    }

    .option-content p {
        font-size: 13px;
    }

    .inspiration-result {
        padding: 20px;
    }

    .inspiration-emoji {
        font-size: 28px;
    }

    .inspiration-title {
        font-size: 20px;
    }

    .inspiration-text {
        font-size: 15px;
    }

    .inspiration-author {
        font-size: 14px;
    }

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

    .inspiration-btn {
        width: 100%;
    }

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

    .onboarding-card {
        padding: 20px;
    }

    .card-icon {
        font-size: 40px;
    }

    .onboarding-card h3 {
        font-size: 20px;
    }

    .onboarding-card p {
        font-size: 14px;
    }
}

/* ============================================================================
   RESPONSIVE DESIGN - MOBILE PHONES
   ============================================================================ */

@media (max-width: 480px) {
    .inspiration-card {
        padding: 18px;
        border-radius: 12px;
    }

    .inspiration-header h2 {
        font-size: 20px;
    }

    .inspiration-subtitle {
        font-size: 13px;
    }

    .inspiration-option {
        flex-direction: column;
        text-align: center;
        padding: 15px;
        min-height: auto;
    }

    .option-icon {
        font-size: 40px;
        margin-bottom: 8px;
    }

    .option-content h4 {
        font-size: 15px;
    }

    .option-content p {
        font-size: 12px;
    }

    .inspiration-result {
        padding: 18px;
    }

    .inspiration-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .inspiration-emoji {
        font-size: 32px;
    }

    .inspiration-title {
        font-size: 18px;
    }

    .inspiration-text {
        font-size: 14px;
    }

    .inspiration-author {
        font-size: 13px;
    }

    .inspiration-btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    .speaker-btn {
        padding: 12px 24px;
        font-size: 15px;
        min-height: 48px;
    }

    .onboarding-card {
        padding: 18px;
    }

    .card-icon {
        font-size: 36px;
        margin-bottom: 12px;
    }

    .onboarding-card h3 {
        font-size: 18px;
    }

    .onboarding-card p {
        font-size: 13px;
    }

    .card-features li {
        font-size: 13px;
        padding: 6px 0;
    }

    .onboarding-btn {
        padding: 12px 18px;
        font-size: 15px;
        min-height: 48px;
    }
}

/* ============================================================================
   RESPONSIVE DESIGN - SMALL PHONES
   ============================================================================ */

@media (max-width: 360px) {
    .inspiration-card {
        padding: 15px;
    }

    .inspiration-header h2 {
        font-size: 18px;
    }

    .inspiration-subtitle {
        font-size: 12px;
    }

    .option-icon {
        font-size: 36px;
    }

    .option-content h4 {
        font-size: 14px;
    }

    .option-content p {
        font-size: 11px;
    }

    .inspiration-result {
        padding: 15px;
    }

    .inspiration-title {
        font-size: 16px;
    }

    .inspiration-text {
        font-size: 13px;
    }

    .onboarding-card {
        padding: 15px;
    }

    .onboarding-card h3 {
        font-size: 16px;
    }
}

/* ============================================================================
   LANDSCAPE ORIENTATION
   ============================================================================ */

@media (max-height: 600px) and (orientation: landscape) {
    .inspiration-card {
        margin-top: 15px;
        padding: 15px;
    }

    .inspiration-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .inspiration-option {
        min-height: auto;
        padding: 12px;
    }

    .option-icon {
        font-size: 28px;
    }
}

/* ============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================ */

/* Focus styles for accessibility */
.inspiration-option:focus,
.inspiration-btn:focus,
.speaker-btn:focus,
.onboarding-btn:focus {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Keyboard navigation support */
.inspiration-option:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.8);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .inspiration-card,
    .inspiration-result,
    .inspiration-option,
    .inspiration-btn,
    .speaker-btn,
    .onboarding-card,
    .onboarding-btn {
        animation: none !important;
        transition: none !important;
    }

    .speaker-btn.speaking {
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .inspiration-option {
        border: 3px solid rgba(255, 255, 255, 0.8);
    }

    .inspiration-result {
        border: 2px solid #333;
    }

    .inspiration-btn,
    .speaker-btn {
        border: 2px solid #000;
    }
}

/* ============================================================================
   SMOOTH SCROLLING
   ============================================================================ */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .inspiration-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .inspiration-option,
    .speaker-btn,
    .inspiration-actions {
        display: none;
    }

    .inspiration-result {
        page-break-inside: avoid;
    }
}

/* ============================================================================
   IN-PLACE RESULT STYLES (Added for "Replace Button" feature)
   ============================================================================ */

/* The active card state */
.inspiration-option.active-result {
    background: rgba(255, 255, 255, 0.95); /* White background for readability */
    color: #333;
    cursor: default; /* Don't show pointer on text */
    padding: 15px;
    display: block; /* Switch from flex to block for content flow */
    text-align: left;
    min-height: 140px; /* Allow it to grow */
    border: 2px solid rgba(255, 255, 255, 0.5);
    animation: flipIn 0.3s ease-out;
}

@keyframes flipIn {
    from { transform: rotateX(90deg); opacity: 0; }
    to { transform: rotateX(0); opacity: 1; }
}

/* Loading Spinner Inline */
.inspiration-loading-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #667eea;
    padding: 20px 0;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

/* Result Content Layout */
.result-content-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

/* Typography inside the card */
.result-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 10px 0;
    color: #333;
}

.result-text.big-text {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    text-align: center;
    font-style: italic;
}

.result-text.small-text {
    font-size: 13px;
    color: #555;
}

.result-title {
    margin: 0 0 5px 0;
    font-size: 15px;
    color: #667eea;
    font-weight: 700;
}

.result-author {
    font-size: 12px;
    color: #888;
    text-align: right;
    font-style: italic;
    margin-top: -5px;
}

.result-meta {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

/* Inline Actions Bar (Buttons) */
.result-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.icon-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    color: #555;
}

.icon-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
    transform: scale(1.1);
}

.icon-btn.close-btn {
    border-color: #ffcdd2;
    color: #d32f2f;
}

.icon-btn.close-btn:hover {
    background: #ffebee;
}