:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f3f4f6;
    color: #111827;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

.main-menu {
    display: flex;
    gap: 8px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    overflow: visible;
}

.menu-links {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.user-menu {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
    align-self: flex-start;
}

.user-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
    white-space: nowrap;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.user-menu summary:hover,
.user-menu[open] summary {
    background: #eef2ff;
    color: #1d4ed8;
}

.user-menu svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    display: grid;
    min-width: 190px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 16px 35px rgba(15, 23, 42, .16);
}

.user-dropdown a,
.user-dropdown button {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    color: #374151;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: #f3f4f6;
    color: #111827;
}

.user-dropdown form {
    display: block;
}

.main-menu a {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.main-menu a:hover {
    background: #eef2ff;
    color: #1d4ed8;
}

main {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 61px);
    padding: 32px 16px;
    box-sizing: border-box;
}

.page-card {
    width: min(900px, 100%);
    padding: 32px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
}

.page-card h1 {
    margin: 0 0 12px;
    font-size: 26px;
}

.page-card p {
    margin: 0;
    color: #4b5563;
}

.auth-card {
    width: min(420px, calc(100vw - 32px));
    padding: 32px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
}

.auth-card h1 {
    margin: 0 0 24px;
    font-size: 28px;
    text-align: center;
}

form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

input {
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    font-size: 15px;
}

input:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
    border-color: #2563eb;
}

button {
    padding: 12px;
    border: 0;
    border-radius: 9px;
    background: #2563eb;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

.secondary-button {
    background: #4b5563;
}

.secondary-button:hover {
    background: #374151;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.validation-summary {
    margin-bottom: 16px;
    color: #dc2626;
    font-size: 14px;
    text-align: center;
}

.validation-summary:empty {
    display: none;
}

.auth-footer {
    margin: 20px 0 0;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.auth-footer a {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

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

.home-card p {
    margin: 0 0 24px;
    color: #4b5563;
}

textarea {
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
}

textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
    border-color: #2563eb;
}

.form-card {
    width: min(720px, 100%);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.auction-list {
    display: grid;
    gap: 16px;
}

.auction-item {
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
}

.auction-item h2 {
    margin: 0 0 8px;
    font-size: 19px;
}

.auction-item p {
    margin: 0 0 16px;
}

.auction-item dl {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0;
}

.auction-item dt {
    margin-bottom: 4px;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
}

.auction-item dd {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 640px) {
    .form-row,
    .auction-item dl {
        grid-template-columns: 1fr;
    }
}

.join-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    padding: 10px 16px;
    border-radius: 9px;
    background: #16a34a;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.join-button:hover {
    background: #15803d;
}

.approval-badge {
    display: inline-block;
    margin: 0 0 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
}

.status-message {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
}

.auction-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.auction-actions form {
    display: inline-flex;
}

.secondary-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 9px;
    background: #4b5563;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.secondary-link:hover {
    background: #374151;
}

.small-button {
    padding: 9px 14px;
    border: 0;
    border-radius: 9px;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.small-button:hover {
    background: #1d4ed8;
}

.danger-button {
    background: #dc2626;
}

.danger-button:hover {
    background: #b91c1c;
}

.approve-button {
    background: #16a34a;
}

.approve-button:hover {
    background: #15803d;
}

.detail-actions {
    margin-bottom: 28px;
}

.user-table {
    display: grid;
    gap: 10px;
}

.user-table-header,
.user-table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border-radius: 10px;
}

.user-table-header {
    background: #eef2ff;
    color: #3730a3;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.user-table-row {
    background: #f9fafb;
}

.user-actions {
    display: flex;
    justify-content: flex-end;
}

.user-table small {
    color: #6b7280;
    font-weight: 500;
}

.dashboard-card {
    width: min(960px, 100%);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 28px;
}

.dashboard-header p {
    margin: 8px 0 0;
    color: #4b5563;
}

.dashboard-header form {
    display: inline-flex;
}

.password-message {
    padding: 10px 14px;
    border-radius: 10px;
    background: #dcfce7;
    color: #166534;
    font-size: 14px;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.dashboard-stat {
    display: grid;
    gap: 10px;
    padding: 24px;
    border-radius: 16px;
    background: #f9fafb;
    color: #111827;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

.dashboard-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
}

.dashboard-stat span {
    font-size: 14px;
    font-weight: 700;
    color: #4b5563;
}

.dashboard-stat strong {
    font-size: 36px;
    line-height: 1;
}

.dashboard-stat.upcoming strong {
    color: #2563eb;
}

.dashboard-stat.active strong {
    color: #16a34a;
}

.dashboard-stat.past strong {
    color: #6b7280;
}

.auction-detail {
    width: min(960px, 100%);
}

.auction-detail header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}

.auction-detail header p {
    margin: 8px 0 0;
}

.status-badge {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #f3f4f6;
    color: #4b5563;
}

.auction-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 28px 0;
    padding: 20px;
    border-radius: 14px;
    background: #f9fafb;
}

.auction-summary dt {
    margin-bottom: 4px;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
}

.auction-summary dd {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.bid-form {
    max-width: 360px;
}

.bid-warning,
.connection-status,
.bid-message {
    margin: 16px 0 0;
    font-size: 14px;
    color: #4b5563;
}

.bid-message {
    color: #dc2626;
    min-height: 20px;
}

.bid-history {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.bid-history h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

#bid-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#bid-list li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f9fafb;
    font-size: 14px;
}

#bid-list strong {
    color: #1d4ed8;
}

#bid-list time {
    color: #6b7280;
}

@media (max-width: 760px) {
    .auction-detail header {
        flex-direction: column;
    }

    .auction-summary,
    .dashboard-grid,
    .user-table-header,
    .user-table-row,
    #bid-list li {
        grid-template-columns: 1fr;
    }

    .user-actions {
        justify-content: flex-start;
    }

    .user-menu summary span {
        display: none;
    }
}

/* Durum rozetleri: tamamlandı */
.status-badge.ended {
    background: #ede9fe;
    color: #6d28d9;
}

.approval-badge.ended {
    background: #ede9fe;
    color: #6d28d9;
}

/* Kazanan bandı */
.winner-banner {
    margin: 0 0 24px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-weight: 700;
}

/* Sayfalama */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination .page-link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.pagination .page-link:hover {
    background: #eef2ff;
    color: #1d4ed8;
}

.pagination .page-link.current {
    background: #2563eb;
    color: #ffffff;
}

.pagination .page-link.disabled {
    color: #9ca3af;
    pointer-events: none;
}

.pagination .page-ellipsis {
    padding: 0 4px;
    color: #9ca3af;
}

/* Outbid bildirim balonu */
.toast-container {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
}

.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #111827;
    color: #f9fafb;
    box-shadow: 0 16px 35px rgba(15, 23, 42, .28);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    animation: toast-in .18s ease-out;
}

.toast a {
    color: #93c5fd;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.validation-error {
    display: block;
    color: var(--danger, #c0392b);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}
