/* JWT Decoder Light Theme Styles */

/* Hidden elements */

/* Dark mode overrides */
[data-theme="dark"] {
    --tool-bg: #0f172a;
    --tool-border: #334155;
    --tool-border-hover: #475569;
    --tool-text: #f8fafc;
    --tool-text-secondary: #94a3b8;
    --tool-input-bg: #1e293b;
    --tool-input-border: #334155;
    --tool-button-bg: #1e293b;
    --tool-button-hover: #334155;
    --tool-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --tool-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --surface-color: #1e293b;
    --surface-hover: #334155;
    --background-color: #0f172a;
    --text-color: #f8fafc;
    --status-info: rgba(96, 165, 250, 0.2);
    --status-success: rgba(34, 197, 94, 0.2);
    --status-error: rgba(248, 113, 113, 0.2);
    --bg-color: #0f172a;
}

/* Dark mode element overrides */
[data-theme="dark"] .tool-card {
    background: var(--bg-card, #1e293b);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .tool-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--input-bg, #1e293b);
    color: var(--text-primary, #f8fafc);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-muted, #64748b);
}

[data-theme="dark"] .tab-btn.active {
    color: white;
}

[data-theme="dark"] label {
    color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 {
    color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] p {
    color: var(--text-secondary, #cbd5e1);
}

/* Dark mode border and element overrides */
[data-theme="dark"] .status-valid {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

[data-theme="dark"] .status-invalid {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
}

[data-theme="dark"] .status-warning {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
}

[data-theme="dark"] .claim-item,
[data-theme="dark"] .token-part,
[data-theme="dark"] .token-preview,
[data-theme="dark"] .info-section,
[data-theme="dark"] .panel-footer,
[data-theme="dark"] .stats-footer,
[data-theme="dark"] .panel-header {
    border-color: #334155;
}

[data-theme="dark"] .warning-item {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
}

.hidden {
    display: none !important;
}

/* Tool Interface */
.tool-interface {
    background: var(--bg-secondary);
    min-height: 60vh;
    padding: 2rem 0;
}

.tool-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Input Panel */
.input-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.input-panel h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.jwt-input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.jwt-input {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: var(--bg-secondary);
}

.jwt-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.jwt-input::placeholder {
    color: #8e8e93;
    font-style: italic;
}

/* Input Actions */
.input-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    var(--bg-primary)-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #357abd 0%, #2c5d8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.btn-outline {
    background: var(--bg-primary);
    color: #4a90e2;
    border: 2px solid #4a90e2;
}

.btn-outline:hover {
    background: #4a90e2;
    color: var(--bg-primary);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* JWT Status */
.jwt-status {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 20px;
}

.jwt-status.success {
    background: var(--color-green-soft);
    color: var(--text-success);
    border: 1px solid #c3e6cb;
}

.jwt-status.error {
    background: var(--color-red-soft);
    color: var(--text-danger);
    border: 1px solid #f5c6cb;
}

/* Decoded Sections */
.decoded-sections {
    display: none;
    gap: 2rem;
}

.section-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #e9ecef 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

.section-content {
    padding: 2rem;
}

.raw-section,
.decoded-section {
    margin-bottom: 1.5rem;
}

.raw-section:last-child,
.decoded-section:last-child {
    margin-bottom: 0;
}

.raw-section label,
.decoded-section label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.encoded-value {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    line-height: 1.4;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.decoded-value {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    var(--bg-primary)-space: pre-wrap;
}

/* Signature Info */
.signature-info {
    margin-top: 1rem;
}

.signature-note {
    background: var(--bg-primary)3cd;
    color: var(--warning-color);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Information Panel */
.info-panel {
    display: none;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-panel h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

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

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.info-item label {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 1rem;
    min-width: 100px;
}

.info-item span {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-word;
    text-align: right;
    flex: 1;
}

/* Token Status */
.token-status-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.status-item.success {
    background: var(--color-green-soft);
    color: var(--text-success);
    border: 1px solid #c3e6cb;
}

.status-item.error {
    background: var(--color-red-soft);
    color: var(--text-danger);
    border: 1px solid #f5c6cb;
}

.status-item.warning {
    background: var(--bg-primary)3cd;
    color: var(--warning-color);
    border: 1px solid #ffeaa7;
}

.status-icon {
    font-size: 1.2rem;
}

.status-text {
    flex: 1;
}

/* Verification Panel */
.verification-panel {
    display: none;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.verification-panel h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

.verification-warning {
    display: flex;
    gap: 1rem;
    background: var(--bg-primary)3cd;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    margin-bottom: 2rem;
}

.warning-icon {
    font-size: 1.5rem;
    color: var(--warning-color);
}

.warning-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--warning-color);
    font-weight: 600;
}

.warning-content p {
    margin: 0;
    color: var(--warning-color);
    line-height: 1.5;
}

.verification-info h4 {
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.verification-info ol {
    color: var(--text-primary);
    line-height: 1.6;
    padding-left: 1.5rem;
}

.verification-info li {
    margin-bottom: 0.5rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: #28a745;
    color: var(--bg-primary);
    border-radius: 6px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-error {
    background: #dc3545;
}

.toast.toast-warning {
    background: #ffc107;
    color: var(--text-primary);
}

/* Hidden State */
.decoded-sections,
.info-panel,
.verification-panel {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        gap: 1.5rem;
    }

    .input-panel,
    .section-panel,
    .info-panel,
    .verification-panel {
        padding: 1.5rem;
    }

    .section-header {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .section-content {
        padding: 1.5rem;
    }

    .input-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        justify-content: center;
    }

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

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .info-item span {
        text-align: left;
    }

    .verification-warning {
        flex-direction: column;
        text-align: center;
    }

    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .jwt-input {
        font-size: 0.8rem;
        min-height: 100px;
    }

    .encoded-value,
    .decoded-value {
        font-size: 0.75rem;
        padding: 0.75rem;
    }

    .section-actions {
        flex-direction: column;
        gap: 0.25rem;
        width: 100%;
    }

    .btn-sm {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* Universal Elements Styles */

/* Tool Information Section */
.tool-info-section {
    background: var(--bg-primary);
    border-top: 1px solid #e9ecef;
    padding: 3rem 0;
}

.tool-info-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.tool-info-content > p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
}

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

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-align: left;
}

.benefit-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: var(--bg-primary);
}

.benefit-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

.benefit-content p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Related Tools Section */
.related-tools-section {
    background: var(--bg-secondary);
    padding: 3rem 0;
    border-top: 1px solid #e9ecef;
}

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

.tool-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: block;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
    text-decoration: none;
    color: inherit;
}

.tool-card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: var(--bg-primary);
}

.tool-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.tool-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Responsive adjustments for universal elements */
@media (max-width: 768px) {
    .tool-benefits {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .related-tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .benefit-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}


