/* Neumorphic Design Variables */
:root {
    --bg-color: #e0e5ec;
    --text-color: #1a202c;
    --text-dark: #000000;
    --text-muted: #4a5568;
    --primary-color: #3a59e2;
    --secondary-color: #1a0fb3;
    --success-color: #38a169;
    --error-color: #e53e3e;
    --warning-color: #dd6b20;
    --shadow-light: #ffffff;
    --shadow-dark: #b8bec9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Neumorphic Card */
.card {
    background: var(--bg-color);
    border-radius: 20px;
    padding: 40px;
    margin: 20px 0;
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
}

h1 {
    color: var(--text-dark);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: -0.5px;
}

h2 {
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    letter-spacing: -0.3px;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.5;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Form Elements */
.form-group {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
}

.input-field {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 15px;
    background: var(--bg-color);
    box-shadow:
        inset 4px 4px 8px var(--shadow-dark),
        inset -4px -4px 8px var(--shadow-light);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    box-shadow:
        inset 3px 3px 6px var(--shadow-dark),
        inset -3px -3px 6px var(--shadow-light);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 16px 30px;
    border: none;
    border-radius: 15px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        5px 5px 10px var(--shadow-dark),
        -5px -5px 10px var(--shadow-light);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow:
        3px 3px 6px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-dark);
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
}

.btn-secondary:hover {
    box-shadow:
        5px 5px 10px var(--shadow-dark),
        -5px -5px 10px var(--shadow-light);
}

.btn-small {
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
    display: inline-block;
    margin: 5px;
}

/* Resource Selection */
.resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.resource-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    background: var(--bg-color);
    box-shadow:
        3px 3px 6px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.resource-item:hover {
    transform: translateY(-2px);
}

.resource-item.selected {
    box-shadow:
        inset 3px 3px 6px var(--shadow-dark),
        inset -3px -3px 6px var(--shadow-light);
}

.resource-item input[type="checkbox"] {
    margin-right: 12px;
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.resource-item input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.resource-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
}

.resource-item:has(input:disabled) label {
    cursor: not-allowed;
}

/* Header Section */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-section h1 {
    margin: 0;
    text-align: left;
}

.header-section .btn {
    width: auto;
    margin: 0;
}

/* Claims Section */
.claims-section .json-viewer {
    max-height: 300px;
}

/* Fetch Buttons */
.fetch-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* JSON Viewer */
.json-viewer {
    background: #ffffff;
    color: #2d3748;
    padding: 24px;
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
    box-shadow:
        inset 3px 3px 6px var(--shadow-dark),
        inset -3px -3px 6px var(--shadow-light);
    border: 1px solid #e2e8f0;
}

.json-viewer:empty::before {
    content: 'No data to display';
    color: #a0aec0;
    font-style: italic;
}

/* Scrollbar Styling */
.json-viewer::-webkit-scrollbar,
.claims-section::-webkit-scrollbar {
    width: 10px;
}

.json-viewer::-webkit-scrollbar-track,
.claims-section::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 10px;
}

.json-viewer::-webkit-scrollbar-thumb,
.claims-section::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.json-viewer::-webkit-scrollbar-thumb:hover,
.claims-section::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Alert Banner */
.alert-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    background: var(--bg-color);
    box-shadow:
        0 3px 6px var(--shadow-dark),
        0 -2px 4px var(--shadow-light);
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.alert-banner.hidden {
    display: none !important;
}

.alert-banner.alert-error {
    border-bottom: 4px solid var(--error-color);
}

.alert-banner.alert-warning {
    border-bottom: 4px solid var(--warning-color);
}

.alert-banner.alert-success {
    border-bottom: 4px solid var(--success-color);
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.alert-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.alert-message {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
}

.alert-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.alert-actions .btn {
    margin: 0;
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
}

@keyframes slideDownBanner {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUpBanner {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Add padding to body when banner is shown */
body:has(.alert-banner:not(.hidden)) {
    padding-top: 100px;
}

/* Error Wrapper */
.error-wrapper {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 700px;
    width: 90%;
    padding: 24px 28px;
    border-radius: 15px;
    background: var(--bg-color);
    box-shadow:
        5px 5px 10px var(--shadow-dark),
        -5px -5px 10px var(--shadow-light);
    z-index: 1000;
    animation: slideDown 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.error-wrapper.error {
    border-left: 5px solid var(--error-color);
}

.error-wrapper.success {
    border-left: 5px solid var(--success-color);
}

.error-wrapper.warning {
    border-left: 5px solid var(--warning-color);
}

.error-wrapper.hidden {
    display: none;
}

.error-content {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.6;
    flex: 1;
}

.error-logout-btn {
    align-self: flex-start;
    margin-top: 5px;
}

.error-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.error-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Toast Messages */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 22px;
    border-radius: 12px;
    background: var(--bg-color);
    box-shadow:
        3px 3px 6px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light);
    min-width: 280px;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.toast-content {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        padding: 25px;
    }

    .resource-list {
        grid-template-columns: 1fr;
    }

    .header-section {
        flex-direction: column;
        gap: 15px;
    }

    .header-section h1 {
        text-align: center;
    }

    .header-section .btn {
        width: 100%;
    }

    .fetch-buttons {
        flex-direction: column;
    }

    .fetch-buttons .btn-small {
        width: 100%;
        margin: 5px 0;
    }
}
