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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* Header */
.app-header {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.brand-link:hover { color: #764ba2; }

.top-nav h1 {
    font-size: 1.8em;
    color: #667eea;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* App Layout */
.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px 0;
    min-height: 100vh;
}

.column {
    display: flex;
    flex-direction: column;
}

/* Textarea Column */
.textarea-column .input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-section label {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

.input-section textarea {
    flex: 1;
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    resize: none;
    transition: border-color 0.3s;
}

.input-section textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-section textarea::placeholder {
    color: #aaa;
}

/* Results Panel */
.results-panel {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 100vh;
    overflow-y: auto;
}

.results-panel h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.5em;
}

.results-panel h3 {
    font-size: 1em;
    color: #333;
    margin-top: 20px;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

/* Stats Section */
.stats-section {
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    border-left: 3px solid #667eea;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #667eea;
}

/* Readability Section */
.readability-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.readability-score {
    font-size: 3em;
    font-weight: 700;
    color: #667eea;
    text-align: center;
}

.readability-score small {
    font-size: 0.4em;
    color: #999;
    display: block;
}

.readability-level {
    flex: 1;
    font-size: 1.1em;
    color: #666;
    line-height: 1.6;
}

/* Keywords List */
.keywords-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.keyword-item {
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.keyword-word {
    font-weight: 600;
    color: #333;
}

.keyword-count {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.empty-message {
    grid-column: 1 / -1;
    color: #999;
    text-align: center;
    padding: 20px;
}

/* Pro Section */
.pro-section {
    background: #f0f7ff;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.pro-section h3 {
    color: #667eea;
    border: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.pro-stats {
    display: grid;
    gap: 12px;
}

.stat-item {
    background: white;
    padding: 12px;
    border-radius: 4px;
    font-size: 0.9em;
}

.stat-item span {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.stat-item div {
    color: #666;
    font-size: 0.9em;
}

/* Pro Unlock */
.pro-unlock {
    background: #fff3e0;
    border: 2px solid #ff9800;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.pro-unlock h3 {
    color: #ff9800;
    border: none;
    padding: 0;
    margin: 0 0 10px 0;
}

.pro-unlock p {
    color: #666;
    margin-bottom: 15px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95em;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #667eea;
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #764ba2;
}

.btn-unlock {
    background: #ff9800;
    color: white;
    width: 100%;
    padding: 12px;
}

.btn-unlock:hover {
    background: #f57c00;
    transform: translateY(-2px);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8em;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover { color: #333; }

.modal-content h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.modal-content p {
    color: #666;
    margin-bottom: 10px;
}

.modal-content ul {
    list-style: none;
    margin: 15px 0;
}

.modal-content li {
    padding: 8px 0 8px 25px;
    position: relative;
    color: #666;
}

.modal-content li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: 600;
}

.wallet-options {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.wallet-address {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.wallet-address strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

.wallet-address code {
    display: block;
    word-break: break-all;
    font-size: 0.85em;
    color: #667eea;
    font-weight: 600;
    background: white;
    padding: 8px;
    border-radius: 4px;
    margin-top: 5px;
}

.tx-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.9em;
}

.tx-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Responsive */
@media (max-width: 1000px) {
    .app-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .results-panel {
        max-height: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .readability-box {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .app-grid {
        gap: 15px;
        padding: 15px 0;
    }

    .results-panel {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .keywords-list {
        grid-template-columns: 1fr;
    }

    .input-section textarea {
        min-height: 300px;
    }

    .modal-content {
        margin: 20px;
        padding: 20px;
    }

    .top-nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .top-nav h1 {
        position: static;
        transform: none;
        width: 100%;
        font-size: 1.3em;
        text-align: center;
    }
}
