* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    touch-action: manipulation;
}
body {
    font-family: "Cairo", sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.header {
    background: #fff;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo img {
    height: 40px;
    width: auto;
}
.logo h1 {
    color: #34495e;
    font-size: 28px;
}
.menu-toggle {
    /* Always hide the mobile menu toggle button */
    display: none; 
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #34495e;
    touch-action: manipulation;
}
nav {
    /* Always show navigation in the desktop (row) layout */
    display: flex; 
}
nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}
nav a {
    color: #34495e;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}
nav a:hover {
    color: #3498db;
}
.main-container {
    flex: 1;
    padding: 20px;
    display: flex;
    justify-content: center;
}
.container {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
}

/* Form Input Base Styles */
#qrForm input.form-input,
#qrForm select.form-input,
#qrForm textarea.form-input {
    width: 100% !important;
    padding: 12px !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    font-size: 1em !important;
    transition: border-color 0.3s !important;
}
.form-input {
    /* Include all existing styles here, and add this line: */
    font-family: 'Cairo', sans-serif; 
}

#qrForm input[type="color"] {
    padding: 0 !important;
    height: 40px !important;
    width: 100% !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
#qrForm input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
#qrForm input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

#qrForm .form-input:focus {
    border-color: #3498db !important;
    outline: none !important;
}

#qrForm .form-input::placeholder {
    color: #999;
    opacity: 1;
}

#qrForm .form-input[readonly] {
    cursor: pointer;
}

/* Textarea-Specific Styles */
#qrForm textarea.form-input {
    resize: vertical !important;
}

/* Short URL Section Styles */
.shorten-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.shorten-toggle {
    width: auto;
    margin: 0;
    transform: scale(1.3);
}

.short-url-stack {
    margin-top: 5px;
    display: none;
    flex-direction: column;
    gap: 5px;
}

.short-url-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.copy-short-url-btn {
    width: auto;
    padding: 12px 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    min-width: 80px;
    cursor: pointer;
    transition: background 0.3s;
}

.copy-short-url-btn:hover {
    background: #2980b9;
}

/* Responsive Layout for Wi-Fi and Text Sections (Desktop-only layout enforced) */
.wifi-input-group {
    display: flex;
    gap: 15px;
}
.wifi-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.wifi-field input {
    display: block;
    width: 100%;
}
.text-input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}


.container h1 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
    text-align: center;
}
.lang-switch {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}
.lang-btn {
    background: none;
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
    touch-action: manipulation;
}
.lang-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lang-btn:hover {
    border-color: #3498db;
    transform: scale(1.1);
}
.lang-btn.active {
    border-color: #2ecc71;
    background: #e8f5e9;
}
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
label {
    color: #34495e;
    font-weight: 500;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Data Type Selector */
.data-type-selector {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
}

.data-type-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #f9f9f9;
    color: #34495e;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    touch-action: manipulation;
}

.data-type-btn i {
    font-size: 1.5em;
    margin-bottom: 5px;
    color: #3498db;
}

.data-type-btn:hover {
    border-color: #3498db;
    background: #ecf0f1;
}

.data-type-btn.active {
    background: #2ecc71;
    color: white;
    border-color: #27ae60;
    box-shadow: 0 2px 5px rgba(46, 204, 113, 0.4);
}

.data-type-btn.active i {
    color: white;
}

/* Mobile-specific styles */
@media (max-width: 600px) {
    .data-type-selector {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    .data-type-btn {
        flex: 0 1 90px;
        padding: 8px;
        font-size: 0.85em;
        min-width: 80px;
    }
}

/* Color Picker (for consistency with previous fix) */
#qrForm input[type="color"] {
    padding: 0 !important;
    height: 40px !important;
    width: 100% !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#qrForm input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

#qrForm input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.options-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.options-row select,
.options-row input[type="color"] {
    flex: 1;
    min-width: 100px;
}

/* Removed the @media (max-width: 600px) block that stacked .options-row */

.options-row input[type="color"] {
    height: 40px;
    padding: 0;
}

input[type="submit"],
button {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background 0.3s;
}

input[type="submit"]:hover:not(:disabled),
button:hover:not(:disabled) {
    background: #27ae60;
}

input[type="submit"]:disabled,
button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.qr-section {
    text-align: center;
    margin: 20px 0;
}

#qrContainer {
    max-width: 100%;
    height: auto;
    background: #fff;
    border: 3px solid #34495e;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#qrCanvas {
    display: none;
}

.download-btn {
    background: #3498db;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    display: none;
    margin-top: 15px;
    transition: background 0.3s;
    cursor: pointer;
    touch-action: manipulation;
}

.download-btn:hover {
    background: #2980b9;
}

.reload-btn {
    background: #ff5733;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-size: 1.1em;
    cursor: pointer;
    display: none;
    margin-top: 15px;
    transition: background 0.3s;
    touch-action: manipulation;
}

.reload-btn:hover {
    background: #e74c3c;
}

.logo-upload-container {
    display: flex;
    gap: 10px;
    align-items: center;
    /* Removed flex-direction: column override from mobile media query */
}

.remove-logo-btn {
    background: #e74c3c;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.3s;
    touch-action: manipulation;
    white-space: nowrap;
    display: none;
}

.remove-logo-btn:hover {
    background: #c0392b;
}

.ad-section {
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    margin-top: 20px;
}

.ad-section h3 {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
}

.ad-block {
    margin: 20px auto;
    max-width: 100%;
}

#adOverlay {
    display: none;
    text-align: center;
    margin-top: 20px;
}

#adOverlay h3 {
    font-size: 14px;
    margin-bottom: 5px;
}

#adOverlay ins {
    display: inline-block;
}

#adOverlay button {
    margin-top: 5px;
    padding: 5px 10px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.counter-display {
    text-align: center;
    margin-bottom: 15px;
    color: #34495e;
    font-weight: 500;
}

.test-form {
    margin-top: 20px;
    text-align: center;
    display: none;
}

.qr-reader-section {
    margin-top: 20px;
    text-align: center;
}

.qr-reader-section h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.qr-reader-note {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

#qrReaderResult {
    margin-top: 10px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    color: #34495e;
    word-break: break-all;
    display: none;
}

#qrReaderResult a {
    color: #3498db;
    text-decoration: none;
    word-break: break-all;
}

#qrReaderResult a:hover {
    text-decoration: underline;
}

#qrReaderResult.error {
    border-color: #e74c3c;
    background: #ffe6e6;
    color: #c0392b;
}

footer {
    text-align: center;
    padding: 15px;
    background: #fff;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    font-size: 0.9em;
    color: #34495e;
    margin-top: auto;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* * REMOVED ALL MOBILE MEDIA QUERIES (@media max-width)
* to force the desktop layout (PC view) on all devices.
* This means the header and navigation will likely break on narrow screens.
*/


/* RTL/LTR Switchers */
[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

[dir="rtl"] {
    direction: rtl;
    text-align: right;
}
/* In your css/styles.css file */
.data-type-btn {
    /* If there are existing styles for this class, keep them. */
    /* Add this line to apply the Cairo font to all three buttons: */
    font-family: 'Cairo', sans-serif;
}
