:root {
    --primary: #2d3436;
    --primary-hover: #636e72;
    --secondary: #00b894;
    --accent: #0984e3;
    --background: #2d3436;
    --surface: #34495e;
    --text: #dfe6e9;
    --text-secondary: #b2bec3;
    --border: #546e7a;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Remove header, footer, and other duplicate styles covered by homecss.css */
/* Keep only tool-specific styles */

body {
    font-family: 'Raleway', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1d2327;
    color: #ffffff;
    background-image: linear-gradient(rgba(29, 35, 39, 0.92), rgba(29, 35, 39, 0.95)), url('/Assets/marble.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navigation {
    z-index: 1000; /* Ensure header stays on top */
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 80px; /* Match header height */
}

.container {
    flex: 1;
    margin: 20px auto 40px; /* Reduced top margin since we have padding-top on page-wrapper */
    max-width: 90%; /* Adjusted from 95% */
    width: 90%;
    background: linear-gradient(145deg, var(--primary), var(--surface));
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    animation: fadeIn 0.5s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: visible; /* Change from hidden to visible */
    box-sizing: border-box; /* Add this to include padding in width calculation */
}

.container:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px -2px rgba(0, 0, 0, 0.15);
}

h1 {
    text-align: center;
    color: #deb897;
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.5em;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), transparent);
    border-radius: 2px;
}

.input-section, .output-section {
    margin: 0;
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
    min-width: 0; /* Prevent children from causing overflow */
}

.input-section::before, .output-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), transparent);
    border-radius: 4px 4px 0 0;
}

label {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

textarea {
    width: 100%;
    height: 400px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    background-color: var(--primary);
    transition: var(--transition);
    resize: vertical;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    letter-spacing: 0.3px;
    color: var(--text);
    overflow: auto; /* Show scrollbar only when needed */
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
    background: var(--surface);
}

/* Custom scrollbar */
textarea::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

textarea::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

textarea::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 6px;
    border: 3px solid rgba(248, 250, 252, 0.8);
}

textarea::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.controls {
    display: flex;
    gap: 1rem;
    background: transparent;
    margin: 2rem 0;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button styles to match main website */
button, select {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: var(--text);
    border: none;
    border-radius: 9999px; /* Fully rounded corners */
    padding: 0.5rem 1.5rem; /* Reduce button padding */
    font-size: 0.9rem; /* Slightly smaller font */
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    min-height: 40px; /* Reduced height */
}

button:hover, select:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

button.secondary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(100, 116, 139, 0.3);
}

button.secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(100, 116, 139, 0.4);
}

/* Add styles for dropdown options */
select option {
    background: #fff;
    color: #333;
    padding: 10px;
    font-weight: normal;
}

select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2.5rem;
    margin: 2.5rem 0;
    position: relative;
    overflow: visible;
    width: 100%;
    min-width: 0; /* Prevent grid from overflowing */
}

/* #language {
    padding: 5px;
    color: #000;
    font-size: 12px;
    background: transparent;
    -webkit-appearance: none;

} */
/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --surface: rgba(30, 41, 59, 0.95);
        --text: #f1f5f9;
        --border: #334155;
        --secondary: #94a3b8;
    }
    
    body {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }
    
    textarea {
        background: rgba(30, 41, 59, 0.8);
        color: #f1f5f9;
    }
    
    .container {
        border-color: rgba(255, 255, 255, 0.05);
    }

    .input-section, .output-section {
        background: rgba(30, 41, 59, 0.7);
        border-color: rgba(255, 255, 255, 0.1);
    }

    textarea {
        background: rgba(15, 23, 42, 0.7);
        color: #f1f5f9;
        border-color: rgba(255, 255, 255, 0.1);
    }

    textarea:focus {
        background: rgba(15, 23, 42, 0.9);
        border-color: var(--primary);
    }

    textarea::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }

    textarea::-webkit-scrollbar-thumb {
        border-color: rgba(15, 23, 42, 0.7);
    }

    .dropdown-menu {
        background: linear-gradient(145deg, #1a1f25, #2d3436);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .user-name {
        color: #f1f5f9;
    }

    .user-email {
        color: #94a3b8;
    }

    .dropdown-menu button {
        background: rgba(255, 255, 255, 0.03);
    }

    .dropdown-menu button:hover {
        background: rgba(255, 255, 255, 0.07);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .page-wrapper {
        padding-top: 60px; /* Adjust for smaller header on mobile */
    }
    
    .container {
        margin: 10px auto;
        padding: 1rem;
        width: 92%; /* Slightly narrower on mobile */
        border-radius: 8px;
        max-width: 95%;
    }
    
    .grid-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 1.5rem 0;
        min-width: 0;
    }
    
    textarea {
        height: 250px;
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem;
    }
    
    h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .controls {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    button, select {
        width: 100%;
        padding: 0.5rem 1rem;
        font-size: 1rem;
        min-height: 36px;
    }

    .input-section, .output-section {
        padding: 1rem;
        margin: 0;
    }

    label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .logo img {
        height: 32px; /* Even smaller on mobile */
    }

    .dropdown-menu {
        position: fixed;
        top: 60px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .profile-photo {
        width: 32px;
        height: 32px;
    }

    .navigation {
        padding: 0.5rem;
    }

    .logo {
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        min-width: auto; /* Allow logo to shrink */
    }

    .logo img {
        height: 24px; /* Smaller logo on mobile */
    }

    .hamburger {
        margin-left: auto; /* Push hamburger to the right */
    }
}

/* Add touch-specific improvements */
@media (hover: none) {
    button:hover, select:hover {
        transform: none;
    }

    button:active, select:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    textarea {
        -webkit-overflow-scrolling: touch;
    }
}

/* Additional improvements for very small screens */
@media (max-width: 380px) {
    h1 {
        font-size: 1.5rem;
    }

    textarea {
        font-size: 14px;
        height: 200px;
    }

    .container {
        padding: 0.5rem;
        max-width: 98%;
    }

    .logo img {
        height: 28px;
    }
    
    button, select {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .navigation {
        padding: 0.25rem;
        gap: 0.5rem;
    }

    .logo {
        font-size: 1rem;
    }

    .logo img {
        height: 20px;
    }

    .container {
        padding: 0.75rem;
    }

    textarea {
        padding: 0.5rem;
    }

    .hamburger {
        scale: 0.8;
    }
}

/* Animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
        filter: blur(8px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
        filter: blur(0);
    }
}

.footer {
    margin-top: auto;
    width: 100%;
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    position: sticky;
    bottom: 0;
    z-index: 999; /* Below header but above content */
}

.logo img {
    height: 40px; /* Reduce logo size */
    width: auto;
}

/* Add new styles for authentication */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.login-button {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.login-button img {
    width: 24px;
    height: 24px;
}

.hidden {
    display: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Add Profile Container Styles */
.profile-container {
    position: relative;
    display: none; /* Hidden by default, shown when logged in */
    background: rgba(45, 52, 54, 0.95); /* Slightly darker background */
    padding: 4px;
    border-radius: 50%;
}

.profile-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #00b894; /* Brighter border color */
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 184, 148, 0.3); /* Subtle glow effect */
}

.profile-photo:hover {
    transform: scale(1.1);
    border-color: #00d1a7; /* Brighter border on hover */
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: linear-gradient(145deg, #2d3436, #34495e); /* Gradient background */
    border-radius: 12px;
    padding: 1rem;
    min-width: 220px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.dropdown-menu.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.user-info {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.user-name {
    font-weight: 600;
    color: #fff; /* Brighter text */
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.user-email {
    font-size: 0.875rem;
    color: #b2bec3; /* Lighter secondary text */
}

.dropdown-menu button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dropdown-menu button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    color: #00b894; /* Accent color on hover */
}

.dropdown-menu button i {
    width: 16px;
    text-align: center;
    color: #00b894; /* Icon color */
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: linear-gradient(145deg, var(--surface), var(--primary));
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideInRight 0.5s ease, fadeOut 1s ease 7s; /* Increased timing */
    backdrop-filter: blur(10px);
    max-width: 300px;
}

.toast.success {
    border-left: 4px solid #00b894;
}

.toast.error {
    border-left: 4px solid #ff7675;
}

.toast.info {
    border-left: 4px solid #0984e3;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Toast Responsive Styles */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
    }

    .toast {
        width: 100%;
        max-width: none;
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }
}