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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    padding-top: 80px;
}

.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0 20px;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 0;
}

.navbar-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.navbar-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.navbar-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #764ba2;
}

.app-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 600px;
}

.sidebar {
    background: #f8f9fa;
    width: 200px;
    padding: 30px 20px;
    border-right: 1px solid #e0e0e0;
}

.sidebar h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-btn {
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    text-align: left;
}

.menu-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: none;
    box-shadow: none;
}

.menu-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.main-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
}

.form-section {
    margin-bottom: 30px;
}

.form-section label {
    display: block;
    margin-bottom: 8px;
    margin-top: 15px;
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-section label:first-child {
    margin-top: 0;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
    font-family: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-help {
    font-size: 0.85rem;
    color: #888;
    margin-top: 5px;
    font-style: italic;
}

.location-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    margin: 0;
}

.tab-btn:hover {
    color: #667eea;
    transform: none;
    box-shadow: none;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    margin-top: 15px;
}

.color-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

.color-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.color-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.color-group label {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #555;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    background: none;
}

input[type="color"]:focus {
    border-color: #667eea;
    outline: none;
}

.color-preview {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    display: inline-block;
}

#reset-colors {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    align-self: flex-start;
}

#reset-colors:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(108, 117, 125, 0.3);
}

@media (max-width: 600px) {
    .color-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .color-input-group {
        align-self: flex-end;
    }
}

#generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 20px auto;
    display: block;
}

#generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

#generate-btn:active {
    transform: translateY(0);
}

.output-section {
    margin-top: 30px;
    text-align: center;
}

#qr-code {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

#qr-code canvas {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

#download-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        margin: 10px;
    }
    
    .sidebar {
        width: 100%;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .menu-options {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .menu-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
    
    .main-content {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
}

.language-selector {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2px;
    backdrop-filter: blur(10px);
}

.language-btn {
    background: transparent;
    color: #667eea;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
    position: relative;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.language-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

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

/* Flag styles */
.flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    display: inline-block;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* British Flag */
.flag-en {
    background: linear-gradient(to bottom, #012169 0%, #012169 33%, #ffffff 33%, #ffffff 66%, #C8102E 66%);
    position: relative;
}

.flag-en::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 40%, #ffffff 40%, #ffffff 45%, #C8102E 45%, #C8102E 55%, #ffffff 55%, #ffffff 60%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, #ffffff 40%, #ffffff 45%, #C8102E 45%, #C8102E 55%, #ffffff 55%, #ffffff 60%, transparent 60%);
}

.flag-en::after {
    content: '';
    position: absolute;
    top: 40%;
    left: 0;
    right: 0;
    height: 20%;
    background: #C8102E;
    z-index: 2;
}

/* Spanish Flag */
.flag-es {
    background: linear-gradient(to bottom, 
        #C60B1E 0%, #C60B1E 25%, 
        #FFC400 25%, #FFC400 75%, 
        #C60B1E 75%, #C60B1E 100%);
}

/* Brazilian Flag */
.flag-pt {
    background: #009739;
    position: relative;
}

.flag-pt::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 7px solid #FEDD00;
    border-bottom: 7px solid #FEDD00;
    clip-path: polygon(0% 50%, 50% 0%, 100% 50%, 50% 100%);
    background: #FEDD00;
    width: 12px;
    height: 8px;
    border: none;
    border-radius: 50%;
}

.flag-pt::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #002776;
    border-radius: 50%;
    z-index: 2;
}

/* Fixed position for pages without navbar */
body > .language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.95);
}

@media (max-width: 768px) {
    .language-btn {
        font-size: 1rem;
        padding: 6px 10px;
        min-width: 36px;
    }
    
    body > .language-selector {
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .language-btn {
        font-size: 0.9rem;
        padding: 4px 8px;
        min-width: 32px;
    }
    
    .language-selector {
        gap: 1px;
        padding: 1px;
    }
}