@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-dark: #020617;
    --bg-light: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --success: #4ade80;
    --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(129, 140, 248, 0.08), transparent 25%);
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 5rem;
    padding-top: 3rem;
    position: relative;
}

.brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 300;
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    padding: 1rem;
}

.tool-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.3);
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(30, 41, 59, 0.6);
}

.icon-box {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: rgba(56, 189, 248, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--accent);
    transition: all 0.4s ease;
    border: 1px solid rgba(56, 189, 248, 0.1);
}

.tool-card:hover .icon-box {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.1) rotate(-5deg);
    border-color: transparent;
    box-shadow: 0 10px 20px -5px var(--accent-glow);
}

.tool-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.tool-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Back Button */
.back-nav {
    margin-bottom: 3rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    font-weight: 500;
}

.back-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

/* Tool Interface Specifics */
.tool-interface {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4rem 2rem;
    margin-bottom: 2.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    position: relative;
    overflow: hidden;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.03);
    transform: scale(1.01);
}

.btn-action {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1.25rem 3rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px -5px var(--accent-glow);
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-action::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 30px -10px var(--accent-glow);
}

.btn-action:hover::after {
    opacity: 1;
}

.btn-action:disabled {
    background: #334155;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: #64748b;
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

/* Results Area */
.result-area {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: none;
    text-align: left;
}

.result-area.active {
    display: block;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.result-header h3 {
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
}

.text-area-styled {
    width: 100%;
    height: 250px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 1.5rem;
    border-radius: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
}

.text-area-styled:focus {
    border-color: var(--accent);
}

.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    margin-top: 1.5rem;
    border-radius: 10px;
    overflow: hidden;
    display: none;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.status-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Signature Canvas */
canvas#signature-pad {
    background: white;
    border-radius: 16px;
    cursor: crosshair;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* File List stylings */
#file-list>div {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

#file-list>div:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    transform: translateX(5px);
}

/* Radio Button Styling */
.format-selector {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.radio-label:hover {
    color: var(--accent);
}

.radio-label input[type="radio"] {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked {
    border-color: var(--accent);
}

.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.65rem;
    height: 0.65rem;
    background: var(--accent);
    border-radius: 50%;
}

/* Signature Section */
.signature-section {
    display: none;
    text-align: left;
    margin-top: 2rem;
    animation: slideUp 0.5s ease;
}

.signature-canvas-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 4px solid rgba(255, 255, 255, 0.1);
}

.action-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}