/* ISCC Brand Styles */

:root {
    /* Brand Colors */
    --iscc-blue: #0054b2;
    --deep-navy: #123663;
    --bright-yellow: #ffc300;
    --coral-red: #f56169;
    --lime-green: #a6db50;
    --sky-blue: #4596f5;
    --light-cyan: #7ac2f7;

    /* Neutrals */
    --white: #ffffff;
    --off-white: #f8f9fa;
    --light-gray: #e9ecef;
    --medium-gray: #6c757d;
    --dark-gray: #343a40;
    --near-black: #212529;

    /* Semantic */
    --primary: var(--iscc-blue);
    --success: var(--lime-green);
    --danger: var(--coral-red);
    --warning: var(--bright-yellow);
    --info: var(--sky-blue);
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Readex Pro', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--near-black);
    background: var(--off-white);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Layout */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--light-gray);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--deep-navy);
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.main {
    flex: 1;
    padding: 2rem;
}

.footer {
    background: var(--white);
    border-top: 1px solid var(--light-gray);
    padding: 1rem 2rem;
    text-align: center;
    color: var(--medium-gray);
    font-size: 0.875rem;
}

.footer a {
    color: var(--medium-gray);
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.admin-container {
    max-width: 1200px;
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--deep-navy);
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--deep-navy);
    margin-bottom: 1rem;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.lead {
    font-size: 1.125rem;
    color: var(--medium-gray);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--medium-gray);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

.upload-card,
.login-card,
.success-card {
    max-width: 500px;
    margin: 0 auto;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--dark-gray);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 84, 178, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.form-row .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.form-row .form-group label {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--deep-navy);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc3545;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--light-gray);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    margin-bottom: 1rem;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: rgba(0, 84, 178, 0.04);
}

.dropzone-content {
    pointer-events: none;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--medium-gray);
    margin-bottom: 1rem;
}

.dropzone .link {
    color: var(--primary);
    text-decoration: underline;
}

.file-input {
    display: none;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 1rem;
}

.progress-bar {
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--iscc-blue), var(--sky-blue));
    border-radius: 4px;
    width: 0%;
    transition: width 0.15s ease-out;
}

.progress-fill.complete {
    background: linear-gradient(90deg, var(--lime-green), #8bc34a);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--medium-gray);
}

#progress-percent {
    font-weight: 600;
    color: var(--deep-navy);
    font-variant-numeric: tabular-nums;
}

/* File List */
.file-list {
    list-style: none;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--off-white);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--near-black);
    text-decoration: none;
}

.file-name:hover {
    color: var(--primary);
}

.file-size {
    color: var(--medium-gray);
    font-size: 0.875rem;
}

.file-remove {
    background: none;
    border: none;
    color: var(--coral-red);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
}

/* Trust Section */
.trust-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light-gray);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--medium-gray);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.trust-item:last-child {
    margin-bottom: 0;
}

.trust-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--lime-green);
}

.trust-expiry .trust-icon {
    color: var(--sky-blue);
}

/* Success */
.success-icon {
    width: 80px;
    height: 80px;
    color: var(--lime-green);
    margin-bottom: 1rem;
}

/* Admin */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tokens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.token-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.token-card.expired {
    opacity: 0.7;
}

.token-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.token-note {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--deep-navy);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

.badge-success {
    background: var(--lime-green);
    color: var(--near-black);
}

.badge-danger {
    background: var(--coral-red);
    color: var(--white);
}

.token-meta {
    color: var(--medium-gray);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.token-meta p {
    margin-bottom: 0.25rem;
}

.token-link {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--off-white);
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.token-link code {
    flex: 1;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-files {
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.token-actions {
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

/* Modal */
dialog.modal {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

dialog.modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Utility */
.inline {
    display: inline;
}

.note {
    background: var(--bright-yellow);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
    .header {
        padding: 1rem;
    }

    .main {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }
}
