/* --- Root Variables Inspired by Your Provided CSS --- */
:root {
    --primary-color: #005c97;
    --secondary-color: #363795;
    --background-color: #f0f2f5;
    --container-bg: #ffffff;
    --text-color: #333;
    --heading-color: #1d2d50;
    --border-color: #dfe4ea;
    --success-color: #28a745;
    --font-family: 'Poppins', sans-serif;
}

/* --- General Reset & Body --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
}

/* --- Header & Navigation (Full Width) --- */
.main-site-header {
    background-color: var(--container-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    padding: 0 25px; /* Consistent padding */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    height: 70px; /* Ensures consistent header height */
}

.logo {
    text-decoration: none;
    display: flex; /* Use flexbox for easier image alignment */
    align-items: center; /* Vertically center the image within the logo link area */
    /* font-size and font-weight removed as it's now an image */
}

/* Removed old text logo styling as it's replaced by an image */
/*
.logo-my { color: var(--text-color); }
.logo-social { color: var(--primary-color); }
.logo-adda { color: var(--text-color); }
*/

/* New styling for the logo image */
.logo-image {
    max-height: 40px; /* Adjusted: Smaller logo height */
    width: auto; /* Maintain aspect ratio */
    display: block; /* Ensures it behaves like a block element */
    vertical-align: middle; /* Ensures proper vertical alignment if not using flex on parent */
}


.nav-menu ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 35px; /* Adjusted: Increased gap between nav items */
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.05em; /* Adjusted: Slightly larger font for nav links */
    transition: color 0.3s ease;
}

.nav-menu a:hover { color: var(--primary-color); }

.login-btn {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white !important;
    padding: 10px 20px; /* Adjusted: More padding for button look */
    border-radius: 6px;
    transition: transform 0.2s;
    font-size: 1.05em; /* Adjusted: Consistent font size with nav links */
}
.login-btn:hover { transform: translateY(-2px); }

.hamburger-menu {
    display: none;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    gap: 8px;
    align-items: center;
}

/* --- Page Content Layout (Full Width) --- */
.page-header {
    text-align: center;
    padding: 40px 25px; /* Consistent padding */
    background-color: #fff;
    margin-bottom: 30px; /* Increased margin */
    border-bottom: 1px solid var(--border-color);
}
.page-header h1 {
    color: var(--heading-color);
    font-size: 2.5em;
    font-weight: 700;
}
.page-subtitle {
    font-size: 1.1em;
    color: #666;
    margin-top: 5px;
}

.container-wrapper {
    display: grid;
    /* Ad sidebars now have a fixed width, main content is flexible */
    grid-template-columns: 200px 1fr 200px;
    gap: 25px; /* Increased gap */
    width: 100%;
    margin: 0 auto;
    padding: 0 25px; /* Consistent padding */
}
.ad-placeholder {
    background-color: #e9ecef;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #6c757d;
    font-weight: bold;
    min-height: 600px;
    position: sticky;
    top: 95px; /* Adjusted for header height + margin */
}

/* --- Tool Grid Redesign --- */
.tool-grid {
    display: grid;
    /* Adjusted for better spacing on full-width layouts */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.tool-card {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px; /* Increased padding */
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border-top: 4px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 92, 151, 0.1);
}
.tool-card i {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}
.tool-card h3 {
    font-size: 1.4em;
    color: var(--heading-color);
    margin-bottom: 12px;
    font-weight: 600;
}
.tool-card p {
    font-size: 0.95em;
    color: #555;
    flex-grow: 1;
    line-height: 1.6;
}

/* --- NEW: Improved Button Style --- */
.use-tool-btn {
    background-color: transparent; /* Outline style */
    color: var(--primary-color); /* Text color matches primary */
    border: 2px solid var(--primary-color); /* Border instead of background */
    border-radius: 6px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 1em;
    font-family: var(--font-family);
    cursor: pointer;
    margin-top: 20px; /* More space */
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.use-tool-btn:hover {
    background-color: var(--primary-color); /* Fills on hover */
    color: white; /* Text becomes white on hover */
    transform: translateY(-2px);
}


/* --- Modal Redesign --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1001;
    padding: 20px;
}
.modal-content {
    background-color: var(--container-bg);
    border-radius: 12px;
    width: 100%;
    max-width: 750px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    padding: 30px 40px;
    border-top: 5px solid var(--primary-color);
    max-height: 90vh;
    overflow-y: auto;
}
.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}
.close:hover { color: var(--primary-color); }
.modal-header h2 { color: var(--heading-color); font-size: 1.8em; margin-bottom: 8px; }
.modal-header p { color: #555; font-size: 1.05em; margin-bottom: 15px; }
.tool-instructions {
    font-size: 0.9em;
    color: #555;
    background-color: #f0f2f5;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}
.form-group { margin: 30px 0; }
textarea, select {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    font-family: var(--font-family);
    transition: border-color 0.3s, box-shadow 0.3s;
}
textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 92, 151, 0.2);
}
#generateBtn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 18px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
#generateBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 92, 151, 0.3);
}

/* --- Result & Loader Styles --- */
.hidden { display: none !important; }
#loader { text-align: center; margin-top: 40px; color: var(--primary-color); }
.spinner { border: 5px solid #f3f3f3; border-top: 5px solid var(--primary-color); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 15px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
#resultContainer h3 { color: var(--heading-color); margin: 0; }
.copy-button {
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.copy-button:hover { background-color: #218838; }
.tool-output {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    background-color: #fdfdfd;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.tool-output h1, .tool-output h2, .tool-output h3 {
    font-weight: 600; color: var(--heading-color); margin-top: 20px; margin-bottom: 10px;
}
.tool-output p { margin-bottom: 15px; }
.tool-output ul, .tool-output ol { margin-left: 25px; margin-bottom: 15px; }
.tool-output li { margin-bottom: 8px; }
.tool-output strong { color: var(--secondary-color); }

/* --- Responsive Design --- */
@media (max-width: 1200px) {
    .container-wrapper {
        grid-template-columns: 1fr;
    }
    .left-ad, .right-ad {
        display: none;
    }
}
@media (max-width: 850px) {
    .nav-menu { display: none; }
    .hamburger-menu { display: flex; }
}
@media (max-width: 480px) {
    .page-header h1 { font-size: 2em; }
    .modal-content { padding: 20px; }
    .container-wrapper { padding: 0 15px; }
    .page-header { padding: 30px 15px; }
}