/*
================================
1. General Reset & Typography
================================
*/
:root {
    --primary-color: #007bff; /* Button/Focus Color (Blue) */
    --secondary-color: #343a40; /* Text Color (Dark Gray) */
    --background-color: #f8f9fa; /* Page Background */
    --card-background: #ffffff; /* Container Background (White) */
    --input-bg: #f0f3f6; /* Input area background */
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--secondary-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
}

/*
================================
2. Main Layout (QR Tool Structure)
================================
*/
.tool-page {
    max-width: 600px; /* Reduced max-width to center the QR result */
    margin: 40px auto;
    padding: 30px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

/* Headers */
.tool-page h1 {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.tool-page p {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/*
================================
3. Input Container & Button
================================
*/

.qr-container {
    padding: 20px;
    background-color: var(--input-bg);
    border-radius: 8px;
    display: flex; /* Flexbox for alignment */
    gap: 15px; /* Space between input and button */
    align-items: stretch; /* Make items fill the height */
    margin-bottom: 30px;
}

#qrText {
    flex-grow: 1; /* Input takes up maximum space */
    padding: 12px 15px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#qrText:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#generateQR {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    flex-shrink: 0; /* Button size is fixed */
}

#generateQR:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

/*
================================
4. QR Result Display
================================
*/
.qr-result {
    display: flex;
    justify-content: center; /* Canvas کو درمیان میں لانے کے لیے */
    align-items: center;
    min-height: 300px; /* QR کوڈ کے لیے کم از کم جگہ */
    padding: 20px;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    background-color: var(--card-background);
}

#qrCanvas {
    /* QRious library renders the code here. No extra styles needed, but setting a background is safe */
    background: white; 
    border: 1px solid #ccc; /* تھوڑا سا border تاکہ نمایاں ہو */
    border-radius: 4px;
}



/* Responsive Adjustments */
@media (max-width: 650px) {
    .tool-page {
        margin: 20px 10px;
        padding: 20px;
    }
    
    .qr-container {
        flex-direction: column; /* Input and button stack vertically on mobile */
        gap: 10px;
    }
    
    #generateQR {
        width: 100%; /* Button takes full width on mobile */
        padding: 15px;
    }
    
    .qr-result {
        min-height: 250px;
    }
}