/* Global Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Red & White Theme - HSL */
    --primary: 354, 85%, 55%;
    /* Professional Red */
    --primary-dark: 354, 85%, 40%;
    --secondary: 220, 15%, 20%;
    /* Dark Slate for contrast */
    --accent: 354, 90%, 65%;

    /* Light Mode Backgrounds */
    --bg-dark: 220, 20%, 97%;
    /* Off-white background */
    --bg-card: 0, 0%, 100%;
    /* Pure white cards */

    /* Text Colors - Dark for Light Mode */
    --text-main: 220, 20%, 15%;
    --text-muted: 220, 10%, 40%;

    /* Glass Effect - Adapted for Light Mode */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-blur: 20px;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: hsl(var(--bg-dark));
    color: hsl(var(--text-main));
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 0, 0, 0.05), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 0, 0, 0.05), transparent 40%);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    color: hsl(var(--text-main));
}

h1 {
    font-size: 3rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary-dark)) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: hsl(var(--text-main));
    /* Dark Text */
}

.logo i {
    color: hsl(var(--primary));
}

.nav-links a {
    color: hsl(var(--text-muted));
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: hsl(var(--primary));
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.grid-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Glass Components */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 2rem;
    transition: var(--transition);
    text-decoration: none;
    /* For links acting as cards */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.glass-card:hover {
    transform: translateY(-5px);
    background: #fff;
    border-color: hsl(var(--primary));
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(var(--primary), 0.1), transparent 60%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.glass-card:hover::before {
    opacity: 1;
}

.tool-icon {
    font-size: 2.5rem;
    color: hsl(var(--primary));
    margin-bottom: 1rem;
    background: rgba(var(--primary), 0.1);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.glass-card:hover .tool-icon {
    background: hsl(var(--primary));
    color: #fff;
    transform: scale(1.1) rotate(5deg);
}

.tool-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: hsl(var(--text-main));
}

.tool-desc {
    font-size: 0.9rem;
    color: hsl(var(--text-muted));
    line-height: 1.5;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    padding: 3rem 1rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: hsl(var(--primary));
    background: rgba(var(--primary), 0.05);
}

.drop-zone i {
    font-size: 3rem;
    color: hsl(var(--text-muted));
    margin-bottom: 1rem;
}

.drop-text {
    color: hsl(var(--text-muted));
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    font-size: 1rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary-dark)) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.4);
}

.btn-secondary {
    background: #fff;
    color: hsl(var(--text-main));
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: hsl(var(--text-muted));
}

.btn-action {
    background: linear-gradient(135deg, hsl(var(--secondary)) 0%, #333 100%);
    color: #fff;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Inputs & Selects */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    background: #fff;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: hsl(var(--text-main));
    /* Ensure dark text */
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    appearance: none;
    /* Uniform look */
}

/* Add custom arrow for selects if appearance is none (optional but good for consistency) */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2 4.5 3 4l5 6 5-6 1 .5-5.247 6.64a.5.5 0 0 1-.72 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 1rem) center;
    padding-right: 2.5rem;
}

input:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 2px rgba(220, 20, 60, 0.1);
}

/* Previews */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.preview-item {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.preview-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.action-bar {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .container {
        padding: 1rem;
    }

    .grid-tools {
        grid-template-columns: 1fr;
    }

    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
}

/* Toastify Custom Override */
.toastify {
    background: #fff !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid var(--glass-border) !important;
    color: hsl(var(--text-main)) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    font-family: 'Outfit', sans-serif !important;
}

.toastify.success {
    border-left: 4px solid #00c851 !important;
}

.toastify.error {
    border-left: 4px solid #ff4444 !important;
}

.toastify.info {
    border-left: 4px solid #33b5e5 !important;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: hsl(var(--bg-card));
    padding: 2rem;
    border-radius: var(--radius-md);
    max-width: 800px;
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .modal-actions {
        justify-content: center;
    }

    .modal-actions button {
        flex: 1;
        min-width: 120px;
    }
}