/* style.css additions */

/* * Style 1: Hides the broken image icon
 * The image tag is present but its source failed, which triggers this selector.
 */
.logo-icon:not([src]):before {
    /* * Hide the broken image icon. The 'alt' text will still be visible 
     * but the broken icon itself will not be displayed, creating a cleaner fallbac
     */
    content: none; 
    /* The 'alt' text remains as the accessibility fallback. */
}

/* * Style 2: Basic styling for the logo section
 * Ensures the image and text are aligned nicely.
 */
.logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Space between logo/icon and text */
}

/* * Style 3: Styling the image/icon
 * This sets a standard size for the logo image.
 */
.logo-icon {
    height: 32px; /* Set a fixed height for the logo */
    width: auto;
}

/* * Style 4: Styling the site name
 * Makes the text prominent and readable.
 */
.site-name {
    font-size: 1.5rem; /* Larger font size */
    font-weight: 700;
    color: #1f2937; /* Dark text color */
}


/* --- 1. Variables & Reset --- */
        :root {
            /* Light Mode Default */
            --bg-body: #f1f5f9;
            --bg-header: #ffffff;
            --bg-card: #ffffff;
            --text-main: #0f172a;
            --text-muted: #64748b;
            --accent: #0284c7; /* Sky Blue */
            --accent-hover: #0ea5e9;
            --border: #e2e8f0;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            --suite-bg: rgba(226, 232, 240, 0.5);
        }

        html.dark {
            /* Dark Mode Overrides */
            --bg-body: #0f172a;       /* Deep Slate */
            --bg-header: #1e293b;     /* Lighter Slate */
            --bg-card: #1e293b;
            --text-main: #f8fafc;
            --text-muted: #94a3b8;
            --accent: #38bdf8;        /* Cyber Blue */
            --accent-hover: #7dd3fc;
            --border: #334155;
            --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
            --suite-bg: rgba(30, 41, 59, 0.5);
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            font-family: 'Segoe UI', Inter, Roboto, sans-serif;
            background-color: var(--bg-body);
            color: var(--text-main);
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        a { text-decoration: none; color: inherit; }

        /* --- 2. Header --- */
        header {
            background-color: var(--bg-header);
            border-bottom: 1px solid var(--border);
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 100;
            transition: background-color 0.3s ease;
        }

        .logo-section {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .logo-icon {
            width: 32px;
            height: 32px;
            fill: var(--accent);
        }

        .site-name {
            font-size: 1.5rem;
            font-weight: 800;
            letter-spacing: -0.5px;
            color: var(--text-main);
        }

        /* Settings Button */
        .settings-container { position: relative; }

        .settings-button {
            background: transparent;
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 0.5rem;
            cursor: pointer;
            color: var(--text-muted);
            transition: all 0.2s;
        }

        .settings-button:hover {
            border-color: var(--accent);
            color: var(--accent);
        }

        .settings-icon { width: 24px; height: 24px; }

        /* Dropdown */
        .dropdown-menu {
            position: absolute;
            top: 120%;
            right: 0;
            background-color: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: var(--shadow);
            width: 220px;
            padding: 0.5rem;
            display: none;
            flex-direction: column;
            gap: 0.25rem;
        }

        .dropdown-menu.show { display: flex; }

        .dropdown-menu a, .dropdown-menu button {
            padding: 0.75rem 1rem;
            border-radius: 6px;
            font-size: 0.9rem;
            color: var(--text-muted);
            background: transparent;
            border: none;
            text-align: left;
            cursor: pointer;
            transition: all 0.2s;
        }

        .dropdown-menu a:hover, .dropdown-menu button:hover {
            background-color: var(--suite-bg);
            color: var(--accent);
        }

        /* --- 3. Main Content --- */
        .main-content {
            flex: 1;
            padding: 3rem 1rem;
            max-width: 1100px;
            margin: 0 auto;
            width: 100%;
        }

        .hero-text {
            text-align: center;
            margin-bottom: 3rem;
        }

        .hero-text h1 {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
            background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .hero-text p { color: var(--text-muted); font-size: 1.1rem; }

        /* Dashboard Grid Layout */
        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 2rem;
            align-items: start;
        }

        /* Tool Cards (Standard) */
        .card-grid {
            display: grid;
            gap: 1.5rem;
        }

        .tool-card {
            background-color: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 1.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .tool-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background-color: var(--accent);
            opacity: 0;
            transition: opacity 0.2s;
        }

        .tool-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--shadow);
            border-color: var(--accent);
        }

        .tool-card:hover::before { opacity: 1; }

        .card-icon {
            font-size: 1.5rem;
            background-color: var(--suite-bg);
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            color: var(--accent);
        }

        .card-info h3 { margin-bottom: 0.25rem; color: var(--text-main); }
        .card-info p { font-size: 0.85rem; color: var(--text-muted); }

        /* PDF Suite Module */
        .pdf-suite {
            background-color: var(--suite-bg);
            border: 2px dashed var(--border);
            border-radius: 20px;
            padding: 2rem;
        }

        .pdf-header { margin-bottom: 1.5rem; text-align: center; }
        .pdf-header h2 { color: var(--text-main); font-size: 1.5rem; margin-bottom: 0.5rem; }
        .pdf-header p { color: var(--text-muted); font-size: 0.9rem; }

        .pdf-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        .pdf-btn {
            background-color: var(--bg-card);
            border: 1px solid var(--border);
            padding: 1rem;
            border-radius: 12px;
            text-align: center;
            transition: all 0.2s;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--text-main);
        }

        .pdf-btn span { font-size: 1.5rem; }

        .pdf-btn:hover {
            border-color: var(--accent);
            color: var(--accent);
            background-color: var(--bg-card);
        }

        /* --- 4. Footer --- */
        footer {
            text-align: center;
            padding: 2rem;
            border-top: 1px solid var(--border);
            color: var(--text-muted);
            font-size: 0.9rem;
            margin-top: auto;
        }

        /* Mobile Responsive */
        @media (max-width: 768px) {
            .dashboard-grid { grid-template-columns: 1fr; }
            .hero-text h1 { font-size: 2rem; }
            .pdf-grid { grid-template-columns: 1fr; }
        }
        /* --- CSS for Digital Signature Converter Page (convertor.html) --- */

/* Utility container for this specific page */
.main-content .container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1rem;
    background-color: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Back Button Style */
.back-button-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}

.back-button-top:hover {
    color: var(--accent);
}

/* Headings and Text */
.main-content h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

.main-content p {
    color: var(--text-muted);
}

/* Instructions Details/Summary */
.instructions details {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.instructions summary {
    font-weight: 600;
    cursor: pointer;
    color: var(--accent);
    list-style: none; /* Hide default arrow */
}

/* Custom list-style for summary arrow */
.instructions summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s;
    color: var(--accent);
}

.instructions details[open] summary::before {
    content: '▼';
}

.instructions ul {
    list-style-type: decimal;
    padding-left: 2rem;
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.instructions li {
    margin-bottom: 0.5rem;
}

/* Input Fields (File, Text, Color) */
.main-content input[type="file"],
.main-content input[type="text"] {
    border: 1px solid var(--border);
    background-color: var(--bg-body); /* Use lighter background for input fields */
    color: var(--text-main);
    border-radius: 8px;
    padding: 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.main-content input[type="file"]:focus,
.main-content input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-hover);
    outline: none;
}

/* Canvas Display */
#imageCanvas {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
    /* Border and shadow to clearly separate canvas area */
    border: 2px dashed var(--border);
    border-radius: 12px;
    background-image: repeating-checkered-bg(); /* Function defined below */
}

/* Checkered Background for Transparency */
@keyframes checked-bg-dark {
    0% { background-position: 0 0, 10px 10px; }
    100% { background-position: -10px -10px, 0 0; }
}

@keyframes checked-bg-light {
    0% { background-position: 0 0, 10px 10px; }
    100% { background-position: -10px -10px, 0 0; }
}

/* Helper function for checkered background */
.main-content #imageCanvas {
    background-color: #eee;
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%),
                      linear-gradient(-45deg, #ccc 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #ccc 75%),
                      linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

html.dark .main-content #imageCanvas {
    background-color: #333;
    background-image: linear-gradient(45deg, #444 25%, transparent 25%),
                      linear-gradient(-45deg, #444 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #444 75%),
                      linear-gradient(-45deg, transparent 75%, #444 75%);
}


/* Action Buttons */
.button-primary,
.button-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.button-primary {
    background-color: var(--accent);
    color: var(--bg-card); /* White/Light text */
    border-color: var(--accent);
}

.button-primary:hover:not(:disabled) {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.4);
}

.button-secondary {
    background-color: var(--bg-body);
    color: var(--accent);
    border-color: var(--accent);
}

.button-secondary:hover:not(:disabled) {
    background-color: var(--accent);
    color: var(--bg-card);
}

.button-primary:disabled,
.button-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Message Box */
.message-box {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-weight: 500;
}

.message-box.error {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.message-box.success {
    background-color: #d1fae5;
    color: #059669;
    border: 1px solid #6ee7b7;
}

html.dark .message-box.error {
    background-color: #450a0a;
    color: #f87171;
    border-color: #7f1d1d;
}

html.dark .message-box.success {
    background-color: #064e3b;
    color: #34d399;
    border-color: #10b981;
}


/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: none;
}

.spinner.show {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.container {
            background-color: #ffffff;
            border-radius: 1.5rem; /* More rounded corners */
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15); /* More pronounced shadow */
            padding: 2.5rem; /* Increased padding */
            width: 100%;
            max-width: 700px; /* Slightly wider container */
            border: 1px solid #e2e8f0; /* Subtle border */
        }
        canvas {
            border: 1px solid #cbd5e0; /* Slightly darker border for canvas */
            border-radius: 1rem; /* Rounded corners for canvas */
            background-color: #f8fafc; /* Light background for canvas */
            max-width: 100%;
            height: auto;
            display: block;
            box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); /* Inner shadow for depth */
            margin-top: 1.5rem; /* Added margin-top */
        }
        .button-primary {
            background-image: linear-gradient(to right, #4f46e5, #7c3aed); /* Stronger gradient */
            color: white;
            padding: 0.85rem 1.75rem; /* Slightly larger padding */
            border-radius: 0.75rem;
            font-weight: 600;
            transition: all 0.2s ease-in-out;
            box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4); /* Enhanced shadow */
            border: none; /* Remove default border */
        }
        .button-primary:hover {
            transform: translateY(-3px); /* More pronounced lift */
            box-shadow: 0 8px 20px rgba(79, 70, 229, 0.5);
        }
        .button-primary:active {
            transform: translateY(-1px);
            box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
        }
        .button-secondary {
            background-color: #e2e8f0;
            color: #4a5568;
            padding: 0.85rem 1.75rem;
            border-radius: 0.75rem;
            font-weight: 600;
            transition: all 0.2s ease-in-out;
            border: none; /* Remove default border */
        }
        .button-secondary:hover {
            background-color: #cbd5e0;
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        }
        .button-secondary:active {
            transform: translateY(-1px);
            box-shadow: 0 2px 5px rgba(0,0,0,0.08);
        }
        .message-box {
            background-color: #fffbeb;
            border: 1px solid #fcd34d;
            color: #b45309;
            padding: 0.75rem;
            border-radius: 0.5rem;
            text-align: center;
            font-size: 0.95rem;
        }
        .message-box.error {
            background-color: #fee2e2;
            border-color: #fca5a5;
            color: #dc2626;
        }
        .message-box.success {
            background-color: #d1fae5;
            border-color: #6ee7b7;
            color: #065f46;
        }
        /* Loading Spinner */
        .spinner {
            border: 4px solid rgba(0, 0, 0, 0.1);
            border-left-color: #6366f1; /* Primary color for spinner */
            border-radius: 50%;
            width: 24px;
            height: 24px;
            animation: spin 1s linear infinite;
            display: none; /* Hidden by default */
        }

        .spinner.show {
            display: block;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Instructions section styling */
        .instructions details {
            background-color: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 0.75rem;
            padding: 1rem 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: 0 4px 10px rgba(0,0,0,0.05);
        }
        .instructions summary {
            font-weight: 700;
            cursor: pointer;
            outline: none;
            color: #4f46e5; /* Primary color for summary */
            font-size: 1.125rem; /* text-lg */
            padding: 0.5rem 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .instructions summary::-webkit-details-marker {
            display: none; /* Hide default marker */
        }
        .instructions summary::after {
            content: '▼'; /* Custom arrow icon */
            font-size: 0.8em;
            transition: transform 0.2s;
        }
        .instructions details[open] summary::after {
            transform: rotate(180deg);
        }
        .instructions ul {
            list-style: decimal;
            padding-left: 1.5rem;
            margin-top: 1rem;
            color: #4a5568;
            line-height: 1.6;
        }
        .instructions li {
            margin-bottom: 0.5rem;
        }
        .instructions strong {
            color: #1a202c;
        }

