/* Core Typography and Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Adjusted background gradient for a softer look consistent across pages */
    background: linear-gradient(to bottom right, #eaf2f8, #d9e6f2); 
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Padding to prevent content from hiding behind the fixed header */
    padding-top: 96px; 
}

/* Header Styling (Fixed Navigation Bar) */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100; /* Ensure the header stays on top of other content */
    background: linear-gradient(to right, #4a90e2, #6aafff); /* Vibrant gradient for header */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15); /* More pronounced shadow for fixed header */
}
header h1 { /* Adjusted h1 in header for consistent sizing/color */
    font-size: 2.25rem; /* Smaller than main h1 for header */
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}
header nav ul {
    list-style-type: none !important;
    padding-left: 0 !important;
}
header nav a {
    color: #e0f2f7; /* Lighter text for nav links */
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}
header nav a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Main Content Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 0.75rem;
    /* Enhanced shadow for a more modern look consistent across content containers */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12); 
    line-height: 1.6;
}

/* Common Headings */
h1 {
    font-size: 2.5rem; /* Base H1 size for content sections */
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    text-align: left;
}
h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #555;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Paragraphs and Lists */
p {
    margin-bottom: 1rem;
    /* Centered text for paragraphs in contact and index intro, left-aligned otherwise */
    /* This might need adjustment per specific P tag in HTML if not universally desired */
}
.container p { /* Adjusting general paragraph in container to be left-aligned */
    text-align: left;
}
.contact-form-container p { /* Specific override for paragraphs within the contact form */
    text-align: center;
}

ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 1rem;
}
ol {
    list-style-type: decimal;
    margin-left: 20px;
    margin-bottom: 1rem;
}

/* Links */
a {
    color: #58a6ff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Back Button */
.back-button {
    background-color: #e0e0e0;
    color: #666;
    padding: 0.85rem 1.75rem;
    border-radius: 0.6rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    margin-bottom: 2.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.back-button:hover {
    background-color: #c0c0c0;
    color: #333;
}

/* Action Buttons (Primary and Secondary) */
.action-button {
    /* Adjusted gradient for a more vibrant look, pulled from contact.html's refined styles */
    background: linear-gradient(to right, #4a90e2, #6aafff); 
    color: #ffffff;
    padding: 0.9rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    /* Adjusted shadow for a softer, deeper effect */
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3); 
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    margin-top: 1.5rem;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.action-button:hover {
    transform: translateY(-2px);
    /* Adjusted hover shadow */
    box-shadow: 0 12px 25px rgba(74, 144, 226, 0.4); 
    /* Invert gradient on hover for visual feedback */
    background: linear-gradient(to right, #6aafff, #4a90e2); 
}
.action-button.secondary {
    background: linear-gradient(to right, #a0a0a0, #c0c0c0); /* Lighter secondary button */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.action-button.secondary:hover {
    background: linear-gradient(to right, #c0c0c0, #a0a0a0); /* Invert gradient on hover */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}


/* Message Boxes & Status Displays */
.message-box {
    background-color: #e3f2fd; /* Lighter background for messages */
    color: #1976d2; /* Darker blue text for messages */
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-size: 0.95rem;
    border: 1px solid #90caf9; /* Softer border for messages */
    display: none; /* Hidden by default */
    animation: fadeIn 0.3s ease-out forwards;
}
/* Specific message area colors from index.html */
.message-area.text-green-400 { color: #28a745; } 
.message-area.text-red-400 { color: #dc3545; } 
.message-area.text-yellow-400 { color: #ffc107; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Contact Page Specific Styles */
.contact-form-container {
    background-color: #fcfdfe; /* Even lighter background */
    border: 1px solid #c0d0e0; /* Slightly more prominent border */
    border-radius: 1rem; /* More rounded corners */
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08); /* Deeper shadow */
    max-width: 600px;
    margin: 2rem auto 0;
}
.contact-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid #a0b0c0; /* Slightly darker border for input */
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: #333;
    background-color: #ffffff;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.contact-textarea:focus {
    border-color: #4a90e2; /* More prominent focus color */
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.4); /* Stronger glow on focus */
}


/* Index Page Specific Tool UI Styles */
.tool-card {
    background-color: #ffffff; /* White background for cards */
    border: 1px solid #d0dce8; /* Lighter border */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, border-color 0.3s ease-in-out, background-color 0.3s ease-in-out, opacity 0.3s ease-in-out;
    border-radius: 0.75rem; /* More rounded */
    overflow: hidden; /* Ensures nothing spills out on transform */
    position: relative;
}
.tool-card:hover {
    transform: translateY(-8px) scale(1.02); /* More pronounced lift */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(88, 166, 255, 0.6); /* Blue glow */
    border-color: #58a6ff; /* Highlight on hover */
    background-color: #f8fcfd; /* Slightly brighter on hover */
}
.tool-card.dimmed {
    opacity: 0.2;
    pointer-events: none; /* Disable clicks on dimmed cards */
}

/* Custom modal styles (used on index.html for "Coming Soon" messages) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Slightly lighter overlay */
    backdrop-filter: blur(5px); /* Subtle blur behind modal */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: linear-gradient(to bottom right, #ffffff, #f0f4f8); /* Gradient background */
    padding: 3rem; /* More padding */
    border-radius: 1.25rem; /* More rounded */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2); /* Deeper shadow */
    max-width: 90%;
    width: 550px; /* Slightly wider */
    color: #333; /* Darker text */
    text-align: center;
    position: relative;
    border: 1px solid #d0dce8; /* Lighter border */
    animation: fadeInScale 0.3s ease-out forwards; /* Entry animation */
}
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.modal-close-button {
    position: absolute;
    top: 1.25rem;
    right: 1.75rem;
    background: none;
    border: none;
    font-size: 1.8rem; /* Larger close button */
    color: #666; /* Darker close button */
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.modal-close-button:hover {
    background-color: #e0e0e0; /* Lighter hover */
    color: #333; /* Darker on hover */
}

/* File upload & Text Input (from index.html) */
.file-upload-container, .text-input-container {
    border: 2px dashed #a0b0c0; /* Lighter dashed border */
    border-radius: 0.75rem;
    padding: 1.5rem; /* More padding */
    text-align: center;
    background-color: #f8fcfd; /* Very light background */
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.file-upload-container.dragover {
     background-color: #e0e8f0;
     border-color: #58a6ff;
}
.file-upload-container:hover {
    background-color: #e0e8f0; /* Lighter hover */
}
.file-upload-container p {
    color: #666; /* Darker text */
}
.file-upload-container .text-blue-400 {
    color: #58a6ff; /* Retain accent color */
    font-weight: 600;
}
#duplicateFinderText { /* Specific ID for duplicate finder textarea */
    width: 100%;
    min-height: 250px; /* Taller textarea */
    background-color: #ffffff; /* White background */
    border: 1px solid #d0dce8; /* Lighter border */
    color: #333; /* Darker text */
    padding: 1.25rem;
    border-radius: 0.75rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#duplicateFinderText:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.4);
}

/* Password input specific styling (from index.html, though not present on current pages) */
.password-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 400px; /* Constrain width */
    margin-top: 1.5rem;
}
.password-input-group input[type="password"] {
    background-color: #ffffff; /* White background */
    border: 1px solid #d0dce8; /* Lighter border */
    color: #333; /* Darker text */
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.password-input-group input[type="password"]:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.4);
}

/* Tool-specific page styling (from index.html) */
.tool-page {
    background: linear-gradient(to bottom right, #ffffff, #f0f4f8); /* Consistent gradient */
    padding: 3.5rem; /* More padding */
    border-radius: 1.25rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    color: #333; /* Darker text */
    margin-top: 2.5rem;
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 100%;
    animation: slideInUp 0.4s ease-out forwards; /* Entry animation */
}
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.tool-page h2 {
    font-size: 3rem; /* Larger heading */
    font-weight: 700;
    color: #1a1a1a; /* Very dark heading */
    margin-bottom: 1.75rem;
    letter-spacing: -0.02em;
}
.tool-page .back-button { /* Overridden for tool pages back button positioning */
    align-self: flex-start;
}
.tool-page .message-area, .results-area {
    min-height: 2.5em; /* More space for messages */
    margin-top: 1.5rem;
    width: 100%;
    text-align: left;
    background-color: #f8fcfd; /* Very light background */
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #d0dce8; /* Lighter border */
    font-size: 1rem;
    color: #333; /* Darker text */
}

/* Previews (from index.html) */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); /* Larger minimum size */
    gap: 1.25rem; /* More space between items */
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #e8f0f8; /* Lighter background */
    border-radius: 1rem;
    border: 1px solid #c0d0e0; /* Lighter border */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}
.preview-item {
    background-color: #ffffff; /* White background */
    border: 1px solid #d0dce8; /* Lighter border */
    border-radius: 0.75rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.preview-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.preview-item img, .preview-item canvas {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem; /* More rounded image corners */
    margin-bottom: 0.75rem;
    background-color: #f0f4f8; /* Ensure a background for transparency */
    transform-origin: center center; /* Ensure rotation is from center */
    transition: transform 0.1s linear; /* Smooth rotation transition */
}
.preview-item .page-number {
     font-size: 0.85rem;
     color: #666; /* Darker gray */
     margin-bottom: 0.6rem;
     font-weight: 500;
}
.preview-item .controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    background-color: rgba(255, 255, 255, 0.7); /* Lighter semi-transparent */
    padding: 0.75rem; /* More padding */
    border-radius: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 10; /* Ensure controls are above image */
}
.preview-item:hover .controls {
    opacity: 1;
}
.preview-item .controls button {
    background-color: #58a6ff;
    color: #ffffff;
    padding: 0.75rem; /* Larger touch target */
    border-radius: 0.6rem; /* More rounded */
    font-size: 1.4rem; /* Larger icon */
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.preview-item .controls button:hover {
    background-color: #79c0ff;
    transform: scale(1.05);
}
.list-disc li { /* Specific for bullet points within tool sections on index.html */
    margin-left: 1.5rem; /* Indent list items */
    color: #666; /* Darker text */
}

/* Footer Styling */
footer {
    background-color: #1a202c; /* Darker blue for footer background */
    padding-top: 2.5rem; /* More padding */
    padding-bottom: 2.5rem; /* More padding */
    margin-top: 4rem; /* More space from main content */
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1); /* Subtle shadow on top of footer */
    color: #a0aec0; /* Lighter text for footer */
    text-align: center;
}
footer p {
    color: #a0aec0; /* Ensure paragraph text color is consistent in footer */
}
footer span {
    color: #fc8181; /* Red heart icon color */
}
