/*
 * ConsoleSniper - Excel-Compatible Spreadsheet Styles
 * Clean, minimal design for professional data entry and analysis
 */

/* ===== SPREADSHEET PAGE LAYOUT ===== */
.spreadsheet-page {
    background: #ffffff;
    color: #000000;
    min-height: 100vh;
}

/* ===== HERO SECTION ===== */
.spreadsheet-hero {
    position: relative;
    padding: 6rem 2rem 5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    background: #f9f9f9;
}

.spreadsheet-hero .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(39, 197, 161, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
}

.spreadsheet-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(#e0e0e0 0.5px, transparent 0.5px);
    background-size: 50px 50px;
    opacity: 0.03;
    pointer-events: none;
}

.spreadsheet-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    text-align: center;
}

.spreadsheet-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #000000;
}

.title-accent {
    background: linear-gradient(135deg, #27c5a1 0%, #6366f1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.spreadsheet-subtitle {
    font-size: 1.1rem;
    color: #666666;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== SPREADSHEET SECTION ===== */
.spreadsheet-section {
    padding: 3rem 2rem;
    max-width: 100%;
    margin: 0 auto;
}

/* ===== TOOLBAR ===== */
.spreadsheet-toolbar {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.toolbar-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: #000000;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.toolbar-btn:hover {
    background: #f5f5f5;
    border-color: #999999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toolbar-btn:active {
    transform: translateY(1px);
}

.toolbar-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.toolbar-btn.primary-btn {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    font-weight: 600;
}

.toolbar-btn.primary-btn:hover {
    background: #333333;
    border-color: #333333;
}

.toolbar-info {
    margin-left: auto;
    padding: 0.75rem 1.5rem;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-size: 0.95rem;
    color: #666666;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
}

/* ===== SPREADSHEET CONTAINER ===== */
.spreadsheet-container {
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid #333333;
    border-radius: 8px;
    background: #ffffff;
    margin-bottom: 2rem;
}

.spreadsheet-wrapper {
    display: inline-block;
    min-width: 100%;
}

/* ===== SPREADSHEET GRID ===== */
.spreadsheet-grid {
    border-collapse: collapse;
    font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    background: #ffffff;
    width: 100%;
}

.spreadsheet-grid thead {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f0f0f0;
}

.spreadsheet-grid th {
    background: #f0f0f0;
    color: #000000;
    font-weight: 700;
    padding: 0.75rem 0.5rem;
    text-align: center;
    border: 1px solid #333333;
    user-select: none;
    min-width: 60px;
    height: 40px;
    vertical-align: middle;
}

.spreadsheet-grid th.row-header {
    width: 50px;
    min-width: 50px;
    padding: 0;
}

.spreadsheet-grid td {
    border: 1px solid #333333;
    padding: 0;
    min-width: 100px;
    height: 40px;
    position: relative;
}

/* Row header cells (1, 2, 3...) */
.spreadsheet-grid td.row-header {
    background: #f0f0f0;
    color: #000000;
    font-weight: 700;
    text-align: center;
    width: 50px;
    min-width: 50px;
    padding: 0.75rem 0.5rem;
    user-select: none;
    vertical-align: middle;
}

/* Regular data cells */
.spreadsheet-grid td.data-cell {
    background: #ffffff;
    color: #000000;
    overflow: hidden;
    word-break: break-word;
    user-select: none;
}

/* Cell content on display */
.cell-display {
    padding: 0.5rem;
    min-height: 40px;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: text;
}

/* Cell input on edit */
.cell-input {
    width: 100%;
    height: 100%;
    padding: 0.5rem;
    border: none;
    outline: none;
    background: #ffffff;
    color: #000000;
    font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    resize: none;
    box-sizing: border-box;
}

/* Selected cell - blue outline only */
.spreadsheet-grid td.selected {
    border: 2px solid #2563eb;
}

.spreadsheet-grid td.selected .cell-display {
    padding-right: calc(0.5rem - 1px);
    padding-left: calc(0.5rem - 1px);
}

/* Sum indicator */
.sum-indicator {
    display: inline-block;
    margin-right: 0.25rem;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.9rem;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile touch optimization */
@media (max-width: 768px) {
    .spreadsheet-section {
        padding: 1.5rem 1rem;
    }

    .spreadsheet-toolbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        align-items: stretch;
    }

    .toolbar-group {
        justify-content: center;
    }

    .toolbar-info {
        margin-left: 0;
        text-align: center;
    }

    .spreadsheet-container {
        border-radius: 4px;
    }

    .spreadsheet-grid th,
    .spreadsheet-grid td {
        min-width: 80px;
        min-height: 44px;
        height: 44px;
        padding: 0;
        font-size: 0.9rem;
    }

    .cell-display {
        min-height: 44px;
        padding: 0.5rem 0.375rem;
        font-size: 0.9rem;
    }

    .cell-input {
        padding: 0.5rem 0.375rem;
        font-size: 0.9rem;
    }

    .toolbar-btn {
        flex: 1;
        justify-content: center;
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .toolbar-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Small mobile screens */
@media (max-width: 480px) {
    .spreadsheet-title {
        font-size: 1.5rem;
    }

    .spreadsheet-subtitle {
        font-size: 0.95rem;
    }

    .spreadsheet-grid th,
    .spreadsheet-grid td {
        min-width: 70px;
        font-size: 0.85rem;
    }

    .cell-display,
    .cell-input {
        padding: 0.375rem;
        font-size: 0.85rem;
    }

    .toolbar-btn {
        padding: 0.625rem 0.375rem;
        font-size: 0.75rem;
    }
}

/* ===== INFO SECTION ===== */
.spreadsheet-info {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
}

.info-content h3 {
    color: #000000;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.feature-list li {
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #333333;
    line-height: 1.6;
    font-size: 0.95rem;
}

.feature-list li strong {
    color: #000000;
    font-weight: 600;
}

/* ===== PRINT STYLES ===== */
@media print {
    .spreadsheet-toolbar,
    .spreadsheet-info {
        display: none;
    }

    .spreadsheet-container {
        max-height: none;
        overflow: visible;
        box-shadow: none;
    }

    .spreadsheet-grid {
        page-break-inside: avoid;
    }
}
