/*
 * FILE: /css/style.css
 * This is the new, single stylesheet for the entire professional
 * "GaVerify" application, based on your video.
 * ** UPDATED with new styles for the Manage List **
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-blue: #4F46E5; /* A professional blue */
    --primary-blue-dark: #4338CA;
    --primary-blue-light: #EEF2FF;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;   /* Page background */
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB; /* Borders */
    --gray-400: #9CA3AF;
    --gray-500: #6B7280; /* Muted text */
    --gray-700: #374151; /* Body text */
    --gray-900: #111827; /* Headings */
    --red: #EF4444;
    --red-light: #FEF2F2;
    --red-dark: #DC2626;
    --green: #22C55E;
    --green-light: #F0FDF4;
    --yellow: #EAB308;
    --yellow-light: #FFFBEB;
    --blue-light: #DBEAFE;
    --blue: #3B82F6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.5;
}

/* --- Main Layout --- */
.wrapper {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    background-color: var(--primary-blue);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}
.nav-link i {
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    background-color: var(--gray-100);
}

.nav-link.active {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue);
    font-weight: 600;
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.main-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* --- Login Page --- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    background-color: var(--gray-50);
}

.login-card {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    background-color: var(--primary-blue);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin: 0 auto 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px var(--primary-blue-light);
}

textarea.form-input {
    min-height: 80px;
    line-height: 1.5;
}

.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}
.btn-primary:hover {
    background-color: var(--primary-blue-dark);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-200);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    background-color: var(--gray-50);
}

.btn-success {
    background-color: var(--green);
    color: var(--white);
    border-color: var(--green);
}
.btn-success:hover {
    background-color: #16A34A;
}

.btn-danger {
    background-color: var(--red);
    color: var(--white);
    border-color: var(--red);
}
.btn-danger:hover {
    background-color: var(--red-dark);
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* --- Cards --- */
.card {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}
.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}
.card-content {
    padding: 1.5rem;
}

/* --- Stats Grid (from your video) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-card .icon {
    font-size: 1.5rem;
    color: var(--primary-blue);
    background-color: var(--primary-blue-light);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card .info h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    white-space: nowrap;
}
.stat-card .info p {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* --- Alerts --- */
.alert {
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alert-success {
    background-color: var(--green-light);
    color: var(--green);
}
.alert-danger {
    background-color: var(--red-light);
    color: var(--red);
}
.alert-warning {
    background-color: var(--yellow-light);
    color: var(--yellow);
}

/* --- File Upload --- */
.file-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--gray-200);
    border-radius: 8px;
    background-color: var(--gray-50);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.file-upload-wrapper:hover {
    border-color: var(--primary-blue);
    background-color: var(--primary-blue-light);
}
.file-upload-wrapper input[type="file"] {
    display: none;
}
.file-upload-icon {
    font-size: 2rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}
.file-upload-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--gray-700);
}
.file-upload-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* --- Instructions Box --- */
.instructions {
    background-color: var(--primary-blue-light);
    border: 1px solid var(--primary-blue);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}
.instructions h3 {
    color: var(--primary-blue-dark);
    margin-top: 0;
    margin-bottom: 0.75rem;
}
.instructions code {
    background-color: var(--white);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.875rem;
}
.instructions ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
}

/* --- Table --- */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
}
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
table.data-table th,
table.data-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}
table.data-table th {
    background-color: var(--gray-50);
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
table.data-table tr:last-child td {
    border-bottom: none;
}
table.data-table td .text-bold {
    font-weight: 600;
    color: var(--gray-900);
}
table.data-table td .text-small {
    font-size: 0.875rem;
}
table.data-table td .text-gray {
    color: var(--gray-500);
}
.actions-cell {
    display: flex;
    gap: 0.5rem;
}
.btn-action {
    background-color: var(--white);
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}
.btn-action:hover {
    background-color: var(--gray-50);
    color: var(--gray-900);
}
.btn-action-primary:hover {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue-dark);
    border-color: var(--primary-blue-light);
}
.btn-action-secondary:hover {
    background-color: var(--blue-light);
    color: var(--blue);
    border-color: var(--blue-light);
}
.btn-action-danger:hover {
    background-color: var(--red-light);
    color: var(--red-dark);
    border-color: var(--red-light);
}

/* --- Badge --- */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-success {
    background-color: var(--green-light);
    color: var(--green);
}
.badge-warning {
    background-color: var(--yellow-light);
    color: var(--yellow);
}
.badge-info {
    background-color: var(--blue-light);
    color: var(--blue);
}

/* --- Progress Bar --- */
.progress-bar-container {
    width: 100%;
    background-color: var(--gray-100);
    border-radius: 8px;
    height: 30px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}
.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-blue);
    transition: width 0.5s ease-in-out;
}
.progress-text {
    text-align: center;
    font-weight: 500;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

/* --- Batch Page --- */
.batch-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.batch-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.batch-stats .stat-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 0.5rem;
}
.batch-stats .stat-card h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-500);
}
.batch-stats .stat-card span {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
}
.batch-stats .stat-card p {
    font-size: 0.875rem;
    color: var(--gray-500);
}
.batch-actions h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.batch-actions p {
    color: var(--gray-500);
    margin-bottom: 1rem;
}

/* --- Modals --- */
.modal-wrapper {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-card {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    animation: modal-fade-in 0.3s ease;
}
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}
.modal-close {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--gray-400);
    background: none;
    border: none;
    cursor: pointer;
}
.modal-close:hover {
    color: var(--gray-900);
}
.modal-content {
    padding: 1.5rem;
}
.modal-content .text-small {
    font-size: 0.875rem;
}
.modal-footer {
    padding: 1.5rem;
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
@keyframes modal-fade-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Verification Page --- */
.verification-details .form-input {
    background-color: var(--gray-50);
    font-weight: 500;
    color: var(--gray-900);
}


/* --- NEW: Manage List View --- */
.manage-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.list-item {
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.list-item:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
}
.list-item-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-grow: 1;
    min-width: 0; /* Important for flex-shrink */
}
.list-item-status-icon {
    font-size: 1.25rem;
}
.list-item-status-icon.status-0 { color: var(--yellow); } /* Pending */
.list-item-status-icon.status-1 { color: var(--green); } /* Generated */
.list-item-status-icon.status-2 { color: var(--blue); } /* Batched */

.list-item-details {
    flex-grow: 1;
    min-width: 0;
}
.item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-meta {
    font-size: 0.875rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-meta span {
    margin-right: 0.5rem;
}
.item-meta span:not(:last-child)::after {
    content: "•";
    margin-left: 0.5rem;
    color: var(--gray-300);
}
.list-item-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}
/* Action buttons with text, as seen in the video */
.list-item-actions .btn-sm {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- NEW STYLES (for Screenshot 12.58.05 PM) --- */

/* This allows the header to have the title on the left and search on the right */
.main-header.with-search {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.header-search {
    position: relative;
    width: 100%;
    max-width: 320px;
}

.header-search .form-input {
    padding-left: 2.5rem; /* Space for the icon */
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

/* New Certificate List Styles */
.cert-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cert-list-item {
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.cert-list-item:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
}

.cert-list-item-details {
    flex-grow: 1;
    min-width: 0; /* Important for flex-shrink */
}

.item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.item-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* New Status Badge (like "sent", "pending") */
.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status-badge.sent {
    background-color: var(--blue-light);
    color: var(--blue);
}
.status-badge.pending {
    background-color: var(--yellow-light);
    color: var(--yellow);
}

.item-email {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    font-size: 0.875rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-meta span {
    margin-right: 0.5rem;
}
.item-meta span:not(:last-child)::after {
    content: "•";
    margin-left: 0.5rem;
    color: var(--gray-300);
}

.cert-list-item-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}
.cert-list-item-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* ... existing styles ... */

/* --- NEW: Verification Page Styles --- */

.verify-wrapper {
    display: flex;
    align-items: flex-start; /* Align to top */
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    background-color: var(--gray-50);
    padding: 2rem;
}

.verify-card {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 600px;
}

.verify-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 1.5rem;
}

.verify-header .logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    background-color: var(--primary-blue);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin: 0 auto 1rem;
}

.verify-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

.verify-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 2rem;
}
.verify-status.verified {
    background-color: var(--green-light);
    color: var(--green);
}
.verify-status.failed {
    background-color: var(--red-light);
    color: var(--red);
}
.verify-status i {
    font-size: 1.25rem;
}

.verify-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.verify-field {
    background-color: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.verify-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.verify-field p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.verify-image-container {
    margin-top: 2rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.verify-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.verify-share {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.verify-share h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-share {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-share.whatsapp {
    background-color: #25D366;
    color: var(--white);
}
.btn-share.linkedin {
    background-color: #0A66C2;
    color: var(--white);
}