/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-size: 0.95rem;
    gap: 0.5rem;
    min-height: 44px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary-light);
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-block {
    width: 100%;
}

/* Cards */
.card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    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);
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.2), 0 0 20px rgba(99, 102, 241, 0.1);
}

@media (min-width: 768px) {
    .card {
        padding: 2rem;
    }
}

.tool-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-top: 4.5rem;
}

.tool-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
    color: var(--primary-light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tool-card:hover .tool-icon {
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(14, 165, 233, 0.2) 100%);
    color: white;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.2);
}

.tool-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
}

.tool-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
    transition: var(--transition);
}

.tool-card:hover h3 {
    color: white;
}

.tool-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 0;
    flex-grow: 1;
}

.tool-badge {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.badge-text {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-image {
    color: #38bdf8;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge-pdf {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-generator {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Favorite button */
.fav-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
}

.fav-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary);
    transform: scale(1.1);
}

.fav-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.fav-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}

.fav-btn.active svg {
    fill: var(--primary);
    stroke: var(--primary);
}

/* Inputs */
.input-group {
    margin-bottom: var(--spacing-md);
}

.label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text);
    transition: var(--transition);
    font-size: 0.95rem;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

.input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(30, 41, 59, 0.2);
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .upload-zone {
        padding: 4rem 2rem;
    }
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.upload-zone:hover .upload-icon {
    color: var(--primary);
    transform: translateY(-5px);
}

/* Spinners */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-dark {
    border-color: rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: flex-start;
}

/* Mobile Component Improvements */
@media (max-width: 767px) {
    .card {
        padding: 1.25rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        width: 100%;
        /* Full width buttons on mobile often easier */
    }

    .input {
        font-size: 16px;
        /* Prevent zoom on iOS */
        padding: 0.75rem;
    }

    .tool-card {
        padding-top: 4rem;
    }

    .upload-zone {
        padding: 2rem 1rem;
    }
}