:root {
    --bg-dark: #f5f5f7;
    --bg-gray: #ffffff;
    --accent-red: #e74c4c;
    --header-red: #b30000;
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.1);
    --text-color: #1d1d1f;
    --font-main: 'Outfit', sans-serif;
    --primary-btn: var(--accent-red);
    --primary-btn-text: #ffffff;
    --success-green: #2e7d32;
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text-color);
}

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0.75rem 2rem;
    z-index: 1000;
    background: white;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid #eee;
    color: #333;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    width: 95%;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.2));
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-transform: capitalize;
    color: #e74c4c;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.4rem 1rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 50px;
    border: 1px solid #eee;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e74c4c;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
}

.logout-link {
    font-size: 0.75rem;
    color: #e74c4c;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.logout-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Desktop Navigation Buttons */
.btn-text {
    background: transparent;
    border: none;
    color: #666;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-text:hover {
    color: #e74c4c;
    background: rgba(231, 76, 76, 0.05);
}

.btn-text:active {
    transform: translateY(0);
}

.badge-pro {
    background: var(--accent-red);
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.usage-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.usage-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    border: 1px solid var(--glass-border);
}

.usage-hint {
    font-size: 0.75rem;
    color: var(--accent-red);
    opacity: 0.9;
    font-weight: 500;
}

/* Pricing UI */
.pricing-container {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.pricing-card {
    background: var(--bg-gray);
    padding: 3rem 2rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.pricing-card.active {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.2);
}

.pro-card {
    position: relative;
    background: linear-gradient(145deg, #1a1a1a, #2a1a1a);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-red);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 1rem;
    border-radius: 50px;
}

.plan-header h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.price span {
    font-size: 1rem;
    opacity: 0.6;
}

.plan-features {
    list-style: none;
    margin-bottom: 3rem;
    flex-grow: 1;
    text-align: left;
}

.plan-features li {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.plan-features li::before {
    content: "✓";
    color: var(--accent-red);
    font-weight: bold;
}

.plan-features li.disabled {
    opacity: 0.4;
    text-decoration: line-through;
}

.plan-features li.disabled::before {
    content: "✕";
    color: #666;
}

main {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.intro-card {
    text-align: center;
    width: 100%;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

p {
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Upload Zone */
.drop-zone {
    max-width: 100%;
    height: 120px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    border: 2px dashed var(--glass-border);
    border-radius: 10px;
    transition: background 0.2s, border-color 0.2s;
    margin-bottom: 1rem;
    position: relative;
}

.drop-zone:hover,
.drop-zone.drop-zone--over {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--accent-red);
}

.drop-zone__input {
    display: none;
}

.drop-zone__prompt {
    font-size: 1rem;
    color: var(--text-color);
}

/* Buttons */
.btn-primary {
    background: var(--primary-btn);
    color: var(--primary-btn-text);
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: var(--text-color);
}

.btn-restore {
    background: rgba(255, 149, 0, 0.15);
    border-color: rgba(255, 149, 0, 0.5);
    color: #ff9500;
}

.btn-restore:hover {
    background: rgba(255, 149, 0, 0.3);
    border-color: #ff9500;
}

.btn-danger {
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid rgba(255, 59, 48, 0.5);
    color: #ff3b30;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: rgba(255, 59, 48, 0.4);
    border-color: #ff3b30;
}

/* Row selection */
.row-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-red);
}

.select-all-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-red);
}

tr.row-selected {
    background: rgba(255, 59, 48, 0.15) !important;
}

tr.row-selected:hover {
    background: rgba(255, 59, 48, 0.25) !important;
}

/* Editable cells */
.editable-cell {
    cursor: text;
    transition: background 0.2s, box-shadow 0.2s;
    min-width: 50px;
}

.editable-cell:hover {
    background: rgba(255, 255, 255, 0.05);
}

.editable-cell:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 2px var(--accent-red);
}

.cell-editing {
    background: rgba(255, 255, 255, 0.15) !important;
}

.cell-modified {
    background: rgba(255, 149, 0, 0.1);
    border-left: 3px solid #ff9500;
}

.cell-saved {
    animation: cellSaveFlash 0.5s ease-out;
}

@keyframes cellSaveFlash {
    0% {
        background: rgba(0, 200, 83, 0.4);
    }

    100% {
        background: rgba(255, 149, 0, 0.1);
    }
}

/* Editable headers */
.editable-header {
    cursor: text;
    transition: background 0.2s, box-shadow 0.2s;
    position: sticky;
    top: 0;
    z-index: 20;
    /* Higher than normal th */
}

.editable-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.editable-header:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 0 0 2px var(--accent-red);
}

.header-editing {
    background: rgba(255, 255, 255, 0.2) !important;
}

.header-modified {
    color: #ff9500;
}

.header-modified::after {
    content: " *";
    color: #ff9500;
}

.header-saved {
    animation: headerSaveFlash 0.5s ease-out;
}

@keyframes headerSaveFlash {
    0% {
        background: rgba(46, 125, 50, 0.4);
    }

    100% {
        background: transparent;
    }
}

.alert.success-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(46, 125, 50, 0.1);
    border: 1px solid rgba(46, 125, 50, 0.3);
    color: #1b5e20;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    animation: slideIn 0.3s ease-out;
}

.success-banner .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #2e7d32;
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    flex-shrink: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Dashboard Layout */
.clean-action-group {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.custom-dedup {
    position: relative;
}

.custom-dedup summary {
    list-style: none;
    user-select: none;
}

.custom-dedup summary::-webkit-details-marker {
    display: none;
}

.col-selector {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 100;
    background: var(--bg-gray);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.col-selector p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.checkbox-item:hover {
    opacity: 0.8;
}

.checkbox-item input {
    cursor: pointer;
}

.dedup-hint {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 1rem;
    font-style: italic;
}

.dashboard-container {
    width: 95%;
    max-width: 1800px;
}

.data-section {
    background: var(--bg-gray);
    border-radius: 16px;
    padding: 0;
    border: 1px solid var(--glass-border);
    overflow-x: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 300px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

th {
    font-weight: 800;
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--text-color);
}

tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

/* Column deletion icon hover effect */
.delete-col-icon {
    opacity: 0;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease;
}

th:hover .delete-col-icon {
    opacity: 1;
}

.delete-col-icon:hover {
    transform: scale(1.2);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .card {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    .dashboard-container {
        width: 100% !important;
        padding: 1.5rem 0.5rem !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    main {
        padding: 0.5rem;
    }

    .main-header {
        padding: 0.5rem 0.75rem;
    }

    .pricing-grid {
        grid-template-columns: 1fr !important;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .logo-container {
        gap: 0.5rem;
    }

    .logo {
        height: 28px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .drop-zone {
        height: 100px;
        padding: 15px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .brand-name {
        font-size: 0.9rem;
    }

    .btn-text {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .header-right {
        gap: 0.5rem !important;
    }

    .user-profile {
        gap: 0.5rem;
    }

    .avatar {
        width: 28px;
        height: 28px;
    }

    .user-name {
        font-size: 0.8rem;
    }

    .logout-link {
        font-size: 0.7rem;
    }

    #usage-indicator {
        font-size: 0.65rem !important;
        padding: 2px 6px !important;
    }

    .nav-buttons {
        gap: 0.5rem;
    }

    .nav-buttons button {
        padding: 0.3rem 0.8rem;
        font-size: 0.75rem;
    }

    .site-footer {
        padding: 1.5rem 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #666;
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hamburger-btn.active {
    background: rgba(0, 0, 0, 0.1);
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Navigation */
@media (max-width: 600px) {
    .hamburger-btn {
        display: flex;
    }

    .header-right {
        display: none !important;
        position: absolute;
        top: calc(100% + 8px);
        left: 10px;
        right: 10px;
        background: white;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 16px;
        flex-direction: column;
        padding: 0.5rem;
        gap: 0;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        border: 1px solid #eee;
        animation: slideDown 0.3s ease;
        overflow: hidden;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

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

    .header-right.mobile-open {
        display: flex !important;
    }

    .header-right .nav-link {
        width: 100%;
        text-align: left;
        padding: 1rem 1.25rem;
        color: #666;
        border-bottom: none;
        border-radius: 10px;
        margin: 2px 0;
        transition: all 0.2s ease;
        font-size: 0.95rem;
    }

    .header-right .nav-link:hover {
        background: rgba(231, 76, 76, 0.08);
        color: #e74c4c;
    }

    .header-right .btn-text {
        background: transparent;
        border: none;
    }

    .header-right .btn-secondary {
        background: #e74c4c;
        color: white;
        border: none;
        margin-top: 0.5rem;
        text-align: center;
    }

    .header-right .btn-secondary:hover {
        background: #d63c3c;
    }

    .header-right .user-profile {
        justify-content: flex-start;
        padding: 1rem 1.25rem;
        background: rgba(0, 0, 0, 0.03);
        border-radius: 10px;
        margin-top: 0.5rem;
        border: 1px solid #eee;
    }

    .header-right .user-info {
        display: block;
    }

    .header-content {
        position: relative;
    }

    .brand-name {
        display: inline;
    }

    #usage-indicator {
        display: block !important;
        width: auto;
        text-align: left;
        background: rgba(0, 0, 0, 0.03) !important;
        border: 1px solid #eee !important;
        color: #666 !important;
        padding: 0.75rem 1.25rem !important;
        font-size: 0.85rem !important;
        border-radius: 10px;
    }
}

/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.footer-tagline {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-copyright {
    font-size: 0.8rem;
    opacity: 0.6;
}

.footer-copyright p {
    margin: 0;
}