/* ratio - Aspect Ratio Calculator Theme */
/* Playful social media-inspired design */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Twitter/X black theme */
    --bg-primary: #000000;
    --bg-secondary: #16181c;
    --bg-tertiary: #1d1f23;
    --bg-hover: #1a1d21;
    --accent-primary: #1d9bf0;
    --accent-secondary: #00ba7c;
    --accent-hover: #1a8cd8;
    --text-primary: #ffffff;
    --text-secondary: #8b98a5;
    --text-muted: #71767a;
    --border-color: #2f3336;
    --border-focus: #1d9bf0;
    --success: #00ba7c;
    --error: #f4212e;
    --warning: #ffd400;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(29, 155, 240, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
}

main.main-content {
    position: relative;
    z-index: 10;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    position: relative;
    z-index: 20;
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-top: 1rem;
    width: fit-content;
    margin-inline: auto;
}

.logo {
    font-size: 4rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    animation: fadeInDown 0.6s ease-out;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Category Navigation */
.category-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
    background: rgba(22, 24, 28, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(47, 51, 54, 0.5);
    flex-wrap: wrap;
    justify-content: center;
    position: sticky;
    top: 1rem;
    z-index: 100;
}

.category-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.category-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.category-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}



/* Sections */
.section {
    background: rgba(22, 24, 28, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(47, 51, 54, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.section.hidden {
    display: none;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Twitter/X Post - Background */
.twitter-post-section {
    position: fixed;
    top:4%;
    left: 20%;
    transform: rotate(-10deg) translateX(-50%);
    width: 90%;
    max-width: 600px;
    z-index: -100;
    pointer-events: none;
    opacity: 1;
}

.twitter-post {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.twitter-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
}

.twitter-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.twitter-post-section:nth-of-type(2) {
    top:8%;
    left: auto;
    right: 20%;
    transform: rotate(12deg) translateX(50%);
}

.twitter-post-section:nth-of-type(2) .twitter-avatar {
    background: linear-gradient(135deg, var(--error), #ff6b9d);
}

.twitter-post-section:nth-of-type(2) .twitter-name {
    color: var(--error);
}

.twitter-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.twitter-name {
    font-weight: 700;
    color: var(--text-primary);
}

.twitter-handle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.twitter-time {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.twitter-content {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.twitter-content p {
    margin-bottom: 0.75rem;
}

.twitter-content p:last-child {
    margin-bottom: 0;
}

.twitter-ratio {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    display: inline-block;
}

.twitter-actions {
    display: flex;
    gap: 2rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.twitter-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.twitter-action:hover {
    color: var(--accent-primary);
}

.action-icon {
    font-size: 1.1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-tertiary);
}

.data-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.3;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.ratio-badge {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    background: rgba(29, 155, 240, 0.15);
    color: var(--accent-primary);
    border-radius: 3px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    border: 1px solid rgba(29, 155, 240, 0.3);
    transition: all 0.2s ease;
    line-height: 1.1;
    margin: 0;
}

.ratio-badge:hover {
    box-shadow: 0 0 8px rgba(29, 155, 240, 0.3);
}

.decimal-cell {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.category-header-cell {
    padding: 0.5rem 0.75rem !important;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    background: rgba(29, 155, 240, 0.1);
    border-top: 1px solid var(--accent-primary);
    border-bottom: 1px solid var(--border-color);
}

.category-header {
    background: rgba(29, 155, 240, 0.05);
}

/* UI/UX Essentials Grid */
.essentials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.essentials-card {
    background: rgba(29, 31, 35, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(47, 51, 54, 0.5);
    padding: 1rem;
    transition: all 0.2s ease;
}

.essentials-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.essentials-card-header i {
    font-size: 1.1rem;
    color: var(--accent-primary);
}

.essentials-card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.essentials-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.essentials-item {
    padding: 0.5rem 0.75rem;
    background: rgba(22, 24, 28, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(47, 51, 54, 0.3);
    transition: all 0.2s ease;
}

.essentials-item:hover {
    background: rgba(22, 24, 28, 0.7);
}

.essentials-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
    line-height: 1.3;
}

.essentials-item-dims {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    margin-bottom: 0.15rem;
    line-height: 1.2;
}

.essentials-item-ratio {
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    line-height: 1.2;
}

/* Aspect Ratio Display for Paper Sizes */
.aspect-ratio-display {
    text-align: center;
    padding: 0.5rem 1rem;
    margin-bottom: 0;
    background: rgba(29, 155, 240, 0.08);
    backdrop-filter: blur(5px);
    border-radius: 6px;
    border: 1px solid rgba(29, 155, 240, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.math-ratio {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
    font-family: 'Courier New', monospace;
}

.math-decimal {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

/* Ratio Tester */
.tester-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.tester-box {
    background: rgba(29, 31, 35, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(47, 51, 54, 0.5);
    transition: all 0.2s ease;
}

.tester-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(22, 24, 28, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(47, 51, 54, 0.5);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.15);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

/* Result Display */
.result-display {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(22, 24, 28, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    border: 1px solid rgba(47, 51, 54, 0.5);
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

.result-decimal {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

/* Dimension Examples */
.dimension-examples {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dimension-example {
    padding: 0.5rem;
    background: rgba(29, 31, 35, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    border: 1px solid rgba(47, 51, 54, 0.5);
    transition: all 0.2s ease;
}

.dimension-example:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

/* Visual Preview */
.visual-preview {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(22, 24, 28, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    border: 1px solid rgba(47, 51, 54, 0.5);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-rectangle {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 8px;
    max-width: 100%;
    max-height: 120px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    border: 2px solid rgba(29, 155, 240, 0.3);
}

/* Footer */
#footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    margin: 0.25rem 0;
}

.footer-subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
    font-style: italic;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #333;
    text-decoration: underline;
}

.footer-separator {
    opacity: 0.5;
}

.footer-copyright {
    margin-top: 1rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-separator {
        display: none;
    }
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

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

    .logo {
        font-size: 3rem;
    }

    .section {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .twitter-post-section:nth-of-type(2) {
        top: auto;
        bottom: 20%;
    }

    .category-nav {
        top: 0.5rem;
        padding: 0.5rem;
    }

    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .tester-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.4rem 0.5rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .twitter-actions {
        gap: 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 0.95rem;
    }

    .section {
        padding: 1rem;
    }

    .data-table {
        font-size: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.35rem 0.25rem;
    }
}

