* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border-radius: 30px;
    padding: 35px 40px;
    box-shadow: 0 25px 50px -8px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.08);
}

/* ===== HEADER ===== */
header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

/* לוגו עליון קטן */
.header-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.12);
}

.logo-top {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.15));
}

.header-title-top {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffd700;
    letter-spacing: 0.5px;
}

/* לוגו ראשי */
.header-main {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
}

.header-content {
    flex: 1;
    min-width: 200px;
}

.logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.3));
    border-radius: 16px;
    background: #1e1e2f;
    padding: 8px;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(90deg, #f7971e, #ffd200);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
    letter-spacing: -0.5px;
}

.subtitle {
    color: #aaa;
    font-size: 0.95rem;
    margin-top: 4px;
    -webkit-text-fill-color: #aaa;
    font-weight: 300;
}

.header-nav {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-link {
    padding: 10px 22px;
    border-radius: 30px;
    text-decoration: none;
    color: #aaa;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.95rem;
    cursor: pointer;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 215, 0, 0.05);
}

.nav-link.active {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.25);
}

/* ===== PASTE SECTION ===== */
.paste-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.radio-group {
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    padding: 5px 10px;
    border-radius: 30px;
}

.radio-label:hover {
    background: rgba(255, 215, 0, 0.05);
}

.radio-label input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked {
    border-color: #ffd700;
    background: #ffd700;
}

.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #1a1a2e;
    border-radius: 50%;
}

.radio-text {
    color: #ccc;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.radio-label:has(input:checked) .radio-text {
    color: #ffd700;
    font-weight: 700;
}

#inputTable {
    width: 100%;
    min-height: 200px;
    background: #1a1a2e;
    color: #ddd;
    border: 1px solid #3a3a5a;
    border-radius: 16px;
    padding: 18px 20px;
    font-family: 'Segoe UI', 'Rubik', Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: border 0.3s;
}

#inputTable:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

#analyzeBtn {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: #1a1a2e;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 14px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.25);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#analyzeBtn:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.4);
}

#analyzeBtn:active {
    transform: scale(0.97);
}

/* ===== RESULTS ===== */
.results {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    padding: 20px 25px;
    min-height: 120px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #ffd700;
    font-size: 1.2rem;
    font-weight: 300;
}

#resultContent {
    font-family: 'Segoe UI', 'Rubik', Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 300;
}

.copy-btn-icon {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: #1a1a2e;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.copy-btn-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.35);
}

.copy-btn-icon.copied {
    background: #51cf66;
    color: #1a1a2e;
}

/* ===== RESULT STYLING ===== */
.rank-header {
    font-weight: 700;
    font-size: 1.2rem;
    color: #ffd700;
    margin-top: 18px;
    margin-bottom: 8px;
    border-bottom: 2px solid #ffd70040;
    padding-bottom: 5px;
    letter-spacing: -0.3px;
}

/* ===== HISTORY ===== */
.history-section {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.history-header h2 {
    color: #ffd700;
    font-size: 1.5rem;
    font-weight: 700;
}

.history-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 15px;
    border-left: 3px solid #ffd700;
}

.history-item .history-meta {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item .history-meta .date {
    color: #aaa;
}

.history-item .history-meta .type {
    color: #ffd700;
    font-weight: 500;
}

.history-item .history-result {
    font-family: 'Segoe UI', 'Rubik', Arial, sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    color: #ccc;
    max-height: 200px;
    overflow-y: auto;
}

.history-item .history-result::-webkit-scrollbar {
    width: 5px;
}

.history-item .history-result::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.history-item .history-result::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 10px;
}

.danger {
    background: rgba(255, 0, 0, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 0, 0, 0.1);
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.danger:hover {
    background: rgba(255, 0, 0, 0.25);
}

/* ===== FOOTER ===== */
footer {
    margin-top: 30px;
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    border-top: 1px solid #2a2a44;
    padding-top: 18px;
    font-weight: 300;
}

/* ============================================ */
/* ========== RESPONSIVE - MOBILE ============= */
/* ============================================ */

@media (max-width: 768px) {
    /* container */
    .container {
        padding: 15px 12px;
        border-radius: 16px;
    }

    /* header */
    .header-top {
        gap: 8px;
        padding-bottom: 8px;
        margin-bottom: 5px;
    }

    .logo-top {
        width: 28px;
        height: 28px;
    }

    .header-title-top {
        font-size: 0.8rem;
        letter-spacing: 0.3px;
    }

    .header-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }

    .logo {
        width: 50px;
        height: 50px;
        padding: 6px;
    }

    header h1 {
        font-size: 1.3rem;
        letter-spacing: -0.3px;
        -webkit-text-fill-color: #ffd700;
        background: none;
        color: #ffd700;
    }

    .subtitle {
        font-size: 0.8rem;
        -webkit-text-fill-color: #999;
        color: #999;
    }

    .header-content {
        min-width: unset;
        width: 100%;
        text-align: center;
    }

    .header-nav {
        width: 100%;
        justify-content: center;
        gap: 5px;
        padding: 4px;
        border-radius: 30px;
    }

    .nav-link {
        padding: 6px 14px;
        font-size: 0.75rem;
        border-radius: 20px;
        flex: 1;
        text-align: center;
        max-width: 80px;
    }

    /* paste section */
    .paste-section {
        padding: 14px 12px;
        border-radius: 14px;
        margin-bottom: 20px;
    }

    .options-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .radio-group {
        justify-content: center;
        gap: 10px;
        padding: 6px 12px;
        border-radius: 30px;
        flex-wrap: wrap;
    }

    .radio-label {
        padding: 3px 8px;
        font-size: 0.8rem;
    }

    .radio-label input[type="radio"] {
        width: 16px;
        height: 16px;
    }

    .radio-text {
        font-size: 0.8rem;
    }

    #analyzeBtn {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.95rem;
        white-space: normal;
        justify-content: center;
        text-align: center;
    }

    #inputTable {
        min-height: 120px;
        font-size: 0.85rem;
        padding: 12px 14px;
        border-radius: 12px;
    }

    /* results */
    .results {
        padding: 14px 12px;
        border-radius: 14px;
        min-height: 80px;
    }

    #resultContent {
        font-size: 0.8rem;
        line-height: 1.6;
    }

    .rank-header {
        font-size: 1rem;
        margin-top: 12px;
        margin-bottom: 5px;
    }

    .copy-btn-icon {
        width: 100%;
        padding: 10px 20px;
        font-size: 0.85rem;
        justify-content: center;
        text-align: center;
    }

    .empty-state {
        padding: 30px 15px;
    }

    .empty-icon {
        font-size: 2.2rem;
    }

    .empty-state p {
        font-size: 0.9rem;
    }

    /* history */
    .history-section {
        padding: 14px 12px;
        border-radius: 14px;
    }

    .history-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .history-header h2 {
        font-size: 1.1rem;
        text-align: center;
    }

    .history-item {
        padding: 12px 14px;
        border-radius: 10px;
    }

    .history-item .history-meta {
        font-size: 0.75rem;
        flex-direction: column;
        gap: 4px;
    }

    .history-item .history-result {
        font-size: 0.75rem;
        max-height: 150px;
    }

    .danger {
        width: 100%;
        text-align: center;
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    /* footer */
    footer {
        font-size: 0.65rem;
        margin-top: 20px;
        padding-top: 12px;
    }
}

/* ===== VERY SMALL PHONES ===== */
@media (max-width: 400px) {
    .container {
        padding: 10px 8px;
        border-radius: 12px;
    }

    header h1 {
        font-size: 1.1rem;
    }

    .logo {
        width: 40px;
        height: 40px;
        padding: 4px;
    }

    .logo-top {
        width: 22px;
        height: 22px;
    }

    .header-title-top {
        font-size: 0.7rem;
    }

    .nav-link {
        padding: 5px 10px;
        font-size: 0.65rem;
        max-width: 60px;
    }

    .radio-label {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .radio-text {
        font-size: 0.7rem;
    }

    #analyzeBtn {
        font-size: 0.8rem;
        padding: 10px 16px;
    }

    #inputTable {
        font-size: 0.75rem;
        min-height: 100px;
        padding: 10px 12px;
    }

    #resultContent {
        font-size: 0.7rem;
    }

    .rank-header {
        font-size: 0.85rem;
    }

    .copy-btn-icon {
        font-size: 0.75rem;
        padding: 8px 16px;
    }
}