/* styles.css */

/* Performance Optimizations */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --bg-color: #f0f0f0;
    --text-color: #333;
    --container-bg: rgba(255, 255, 255, 0.8);
    --input-bg: #fff;
    --input-border: #ccc;
    --button-bg: #00bfff;
    --button-hover: #009acd;
    --button-text: #fff;
    --toggle-bg: #f4f4f4;
    --toggle-border: #d1d1d1;
}

.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --container-bg: rgba(0, 0, 0, 0.8);
    --input-bg: #333;
    --input-border: #555;
    --button-bg: #00bfff;
    --button-hover: #009acd;
    --button-text: #fff;
    --toggle-bg: #333;
    --toggle-border: #555;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
    contain: layout style;
    font-display: swap;
}

.top-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--container-bg);
}

#darkModeToggle {
    background-color: var(--toggle-bg);
    border: 2px solid var(--toggle-border);
    cursor: pointer;
    width: 50px;
    height: 26px;
    border-radius: 13px;
    position: relative;
    transition: background-color 0.3s;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

#darkModeToggle::before {
    content: '🌞';
    font-size: 16px;
}

#darkModeToggle::after {
    content: '🌙';
    font-size: 16px;
}

#darkModeToggle span {
    position: absolute;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--button-bg);
    transition: transform 0.3s, background-color 0.3s;
    will-change: transform;
}

.dark-mode #darkModeToggle span {
    transform: translateX(24px);
}

/* Language Switcher */
.language-switcher {
    margin-left: auto;
    display: flex;
    gap: 5px;
    background: var(--container-bg);
    border-radius: 20px;
    padding: 3px;
    border: 1px solid var(--input-border);
}

.lang-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-color);
    transition: all 0.3s ease;
    width: auto;
}

.lang-btn.active {
    background: var(--button-bg);
    color: var(--button-text);
}

.lang-btn:hover {
    background: var(--button-hover);
    color: var(--button-text);
}

/* Language Content */
.lang-content {
    display: none;
}

.lang-content.active {
    display: block;
}

/* Quick Links Navigation */
.quick-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.quick-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background: var(--container-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    transition: all 0.3s ease;
    font-size: 14px;
    will-change: transform, background-color;
}

.quick-links a:hover {
    background: var(--button-bg);
    color: var(--button-text);
    transform: translateY(-2px);
}

/* How It Works Section */
.info-section {
    margin: 30px 0;
    padding: 20px;
    background: var(--container-bg);
    border-radius: 10px;
    border: 1px solid var(--input-border);
}

.info-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-color);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.step {
    text-align: center;
    padding: 15px;
    background: var(--input-bg);
    border-radius: 8px;
    border: 1px solid var(--input-border);
    transition: transform 0.3s ease;
    will-change: transform;
    contain: layout;
}

.step:hover {
    transform: translateY(-3px);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--button-bg);
    color: var(--button-text);
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
}

.step h3 {
    margin: 10px 0 5px 0;
    color: var(--text-color);
}

.step p {
    margin: 0;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.4;
}

/* FAQ Section */
.faq-section {
    margin: 40px 0;
    padding: 30px;
    background: var(--container-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.faq-section h2 {
    color: var(--text-color);
    margin-bottom: 25px;
    text-align: center;
    font-size: 28px;
    font-weight: 600;
}

.faq-item {
    margin-bottom: 20px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    contain: layout;
}

.faq-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.faq-question {
    background: var(--input-bg);
    padding: 18px 20px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: var(--button-hover);
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    background: var(--container-bg);
    color: var(--text-color);
    line-height: 1.6;
    transition: all 0.3s ease;
    will-change: max-height, padding;
}

.faq-item.active .faq-answer {
    padding: 20px;
    max-height: 200px;
}

/* Footer Updates */
.footer-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--button-bg);
}

/* Tablet Design */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        max-width: 700px;
        padding: 25px;
    }
    
    .steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .top-bar {
        padding: 12px 25px;
    }
    
    .info-section, .faq-section {
        padding: 25px;
    }
}

/* Mobile Design */
@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 20px;
        margin: 10px auto;
    }
    
    .top-bar {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .language-switcher {
        margin-left: 0;
        order: -1;
    }
    
    .quick-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .quick-links a {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .step {
        padding: 20px 15px;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .info-section, .faq-section {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .faq-section h2 {
        font-size: 24px;
    }
    
    .faq-question {
        padding: 15px;
        font-size: 16px;
    }
    
    .faq-answer {
        font-size: 14px;
    }
    
    .code-container {
        flex-direction: column;
        gap: 10px;
    }

    #copyCodeButton {
        width: 100%;
    }
    
    header {
        padding: 15px 0;
    }
    
    header h1 {
        font-size: 24px;
        margin: 0;
    }
}

header {
    text-align: center;
    padding: 20px 0;
}

/* Desktop optimizations */
@media (min-width: 769px) {
    .container {
        max-width: 900px;
        padding: 50px;
    }
    
    .top-bar {
        padding: 20px 50px;
    }
    
    .info-section {
        padding: 40px;
        margin: 40px 0;
    }
    
    .faq-section {
        padding: 50px;
        margin: 50px 0;
    }
    
    .steps {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    
    .step {
        padding: 30px 20px;
    }
    
    .quick-links {
        gap: 40px;
        margin: 30px 0;
    }
    
    .quick-links a {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    header {
        padding: 30px 0;
    }
    
    header h1 {
        font-size: 36px;
        margin-bottom: 10px;
    }
    
    .faq-section h2 {
        font-size: 32px;
        margin-bottom: 30px;
    }
    
    .faq-question {
        padding: 20px 25px;
        font-size: 18px;
    }
    
    .faq-answer {
        font-size: 16px;
        line-height: 1.7;
    }
    
    .faq-item.active .faq-answer {
        padding: 25px;
    }
    
    #input-section {
        gap: 15px;
        margin-bottom: 30px;
    }
    
    input[type="text"] {
        padding: 15px;
        font-size: 16px;
    }
    
    button {
        padding: 15px 25px;
        font-size: 16px;
    }
    
    .timer {
        font-size: 20px;
        margin-top: 15px;
    }
}

.container {
    max-width: 600px;
    width: 90%;
    margin: 20px auto;
    padding: 30px;
    background: var(--container-bg);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#input-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.input-hint {
    display: none;
}

.example-key {
    display: none;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background-color: var(--input-bg);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    box-sizing: border-box;
}

button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

button:hover {
    background-color: var(--button-hover);
}

.code-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#twoFactorCode {
    flex-grow: 1;
}

#copyCodeButton {
    width: auto;
    white-space: nowrap;
}

.timer {
    text-align: center;
    font-size: 18px;
    margin-top: 10px;
}

.hidden {
    display: none;
}

#ad-section {
    margin-top: 20px;
    text-align: center;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: auto;
    background-color: var(--container-bg);
}

/* Media query đã được tích hợp vào responsive design mới ở trên */

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #f1f1f1;
    padding: 20px;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: none;
}

.cookie-consent p {
    margin: 0 0 10px 0;
}

.cookie-consent button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 4px;
}

.cookie-consent a {
    color: #0066cc;
    text-decoration: none;
}

.cookie-consent a:hover {
    text-decoration: underline;
}