/* UI/UX Pro Max - Premium Blog Styling */
:root {
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --text-primary: #1e293b;
    --text-secondary: #475569;
}

body {
    background-color: #f8fafc;
    background-image:
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    font-family: 'Raleway', sans-serif;
    color: var(--text-primary);
}

/* Super Human Typography */
.blog-content p {
    font-size: 1.15rem;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 68ch;
    /* Optimal reading line length */
    margin-left: auto;
    margin-right: auto;
}

.blog-content h2,
.blog-content h3 {
    font-family: 'Lora', serif;
    color: var(--text-primary);
    font-weight: 700;
    max-width: 68ch;
    margin-left: auto;
    margin-right: auto;
    margin-top: 3rem;
}

/* 3D Glass Cards */
.formulas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin: 4rem 0;
    perspective: 1000px;
}

.formula-card-3d {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    /* Smooth but instant for tilt */
    overflow: hidden;
}

.formula-card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--primary-gradient);
}

.formula-rank {
    font-family: 'Lora', serif;
    font-size: 5rem;
    font-weight: 700;
    color: #e2e8f0;
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 0;
    opacity: 0.5;
    line-height: 1;
}

.formula-card-content {
    position: relative;
    z-index: 1;
}

.formula-card-3d h3 {
    font-size: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    color: #0f172a;
}

.formula-tag {
    display: inline-block;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.formula-card-3d ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
}

.formula-card-3d li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: #475569;
}

.formula-card-3d li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Floating Action Bar */
.pro-max-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 2000;
}

.action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    color: #64748b;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.action-btn:hover {
    transform: translateY(-4px) scale(1.05);
    color: #10b981;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.action-btn.active {
    background: #10b981;
    color: white;
    animation: pulse 2s infinite;
}

.action-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 70px;
    background: #1e293b;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: all 0.2s ease;
}

.action-btn:hover::after {
    opacity: 1;
    transform: translateX(0);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Summary Modal */
.summary-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.summary-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.summary-modal {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.summary-modal-overlay.active .summary-modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

/* Audio Menu */
.audio-menu-overlay {
    position: fixed;
    bottom: 90px;
    right: 2rem;
    z-index: 2100;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.audio-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.audio-menu {
    background: white;
    padding: 1rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 220px;
}

.audio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    color: #475569;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
}

.audio-option:hover {
    background: #f1f5f9;
    color: #10b981;
}

.audio-option i {
    font-size: 1.25rem;
}

.action-btn.playing {
    background: #ef4444;
    /* Stop button color */
    color: white;
    border-color: #ef4444;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}