/* Modern Instagram Fonts CSS */

/* Skip to content link for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only-focusable:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 10000;
    width: auto;
    height: auto;
    padding: 15px 25px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --bg-main: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: 70px;
    padding-bottom: 60px;
    min-height: 100vh;
}

/* Prevent layout shift from font loading */
@font-face {
    font-family: system-ui;
    font-display: swap;
}

/* Optimize image loading to prevent layout shift */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col-md-12, .col-md-6, .col-sm-6 {
    padding: 0 10px;
    width: 100%;
}

@media (min-width: 768px) {
    .col-sm-6 {
        width: 50%;
    }
}

@media (min-width: 992px) {
    .col-md-6 {
        width: 50%;
    }
}

.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    box-shadow: var(--shadow);
}

.navbar-fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-header {
    display: flex;
    align-items: center;
    padding: 0;
    min-height: 60px;
}

.navbar-brand {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    padding: 15px;
    transition: all 0.3s;
}

.navbar-brand:hover {
    color: var(--primary-dark);
    transform: scale(1.05);
}

.navbar-toggle {
    display: none;
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}

.navbar-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    margin: 4px 0;
}

.navbar-collapse {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav {
    margin: 0;
}

.navbar-nav > li {
    position: relative;
}

.navbar-nav > li > a {
    display: block;
    padding: 15px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.navbar-nav > li > a:hover {
    color: var(--primary);
}

.navbar-right {
    margin: 0;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle .caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-top: 5px solid;
    border-right: 5px solid transparent;
    border-left: 5px solid transparent;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    display: none;
    min-width: 180px;
    padding: 8px 0;
    margin: 8px 0 0;
    background: white;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu > li > a {
    display: block;
    padding: 10px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a.active {
    background: var(--primary);
    color: white;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.text-center {
    text-align: center;
}

.list-unstyled {
    list-style: none;
    padding: 0;
}

.panel {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    overflow: hidden;
    /* Prevent layout shift */
    min-height: 200px;
}

.panel-heading {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 30px 20px;
    border: none;
}

.panel-heading h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.panel-body {
    padding: 30px;
}

.form-field {
    margin-bottom: 20px;
}

.form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.word-count {
    text-align: right;
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

#font-list {
    padding: 0;
    margin: 20px 0 0 0;
    /* Prevent layout shift - reserve space for results */
    min-height: 1400px;
}

#font-list li {
    background: var(--bg-main);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
    transition: all 0.3s;
    /* Prevent layout shift */
    min-height: 80px;
    display: flex;
    align-items: center;
}

#font-list li:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

#font-list li input {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    /* Prevent layout shift */
    width: 80px;
}

.font-text {
    padding-right: 100px;
    font-size: 22px;
    color: var(--text-primary);
    word-break: break-word;
    font-weight: 500;
    /* Prevent layout shift */
    min-height: 30px;
    flex: 1;
}

.btn-copyit {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-copyit:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.btn-copyit:active {
    transform: scale(0.95);
}

.tool-note {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: none;
    border-left: 4px solid #f59e0b;
    border-radius: var(--radius);
    padding: 20px;
    margin: 30px 0;
}

.tool-note p {
    color: #78350f;
    line-height: 1.7;
    margin-bottom: 10px;
    font-size: 15px;
}

.tool-note .p-right {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.tool-note .p-right img {
    width: 150px;
    border-radius: 8px;
}

.article-content {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    margin-top: 30px;
    box-shadow: var(--shadow);
}

.article-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.article-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.article-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
    font-size: 16px;
}

.article-content .conclusion {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
}

.footer {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 30px 0;
    text-align: center;
    margin-top: 40px;
}

.footer p {
    margin: 0 0 10px 0;
    opacity: 0.9;
}

.footer a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .navbar-toggle {
        display: block;
    }
    
    .navbar-collapse {
        display: none;
        width: 100%;
        flex-direction: column;
        order: 3;
    }
    
    .navbar-collapse.in {
        display: flex !important;
    }
    
    .navbar-header {
        flex: 1;
        justify-content: space-between;
        width: auto;
    }
    
    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .navbar-nav > li {
        width: 100%;
    }
    
    .navbar-nav > li > a {
        padding: 12px 15px;
        border-top: 1px solid var(--border);
    }
    
    .navbar-right {
        margin-left: 0;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: 0;
        background: var(--bg-main);
    }
    
    .panel-heading h1 {
        font-size: 24px;
    }
    
    .panel-body {
        padding: 20px;
    }
    
    .font-text {
        font-size: 18px;
        padding-right: 80px;
    }
    
    .btn-copyit {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .tool-note {
        padding: 16px;
    }
    
    .tool-note p {
        font-size: 14px;
    }
    
    .tool-note .p-right {
        flex-direction: column;
    }
    
    .tool-note .p-right img {
        width: 100%;
    }
    
    .article-content {
        padding: 24px;
    }
    
    .article-content h2 {
        font-size: 22px;
    }
    
    .article-content h3 {
        font-size: 18px;
    }
    
    .article-content p {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    #font-list li {
        padding: 15px;
    }
    
    .article-content {
        padding: 20px;
    }
}