body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f7fa;
    margin: 0;
    padding: 0;
    color: #2c3e50;
}

header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 14px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
}

nav {
    display: flex;
    gap: 8px;
}

nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

nav a:hover {
    background-color: rgba(255,255,255,0.15);
}

nav a.active {
    background-color: rgba(255,255,255,0.25);
    color: white;
}

.header-btn {
    padding: 8px 20px;
    background-color: white;
    color: #1e3c72;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.2s;
}

.header-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.main-layout {
    display: flex;
    height: calc(100vh - 64px);
    position: relative;
}

#alerts-sidebar {
    width: 380px;
    background-color: white;
    border-right: 2px solid #e1e8ed;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 2px 0 12px rgba(0,0,0,0.06);
}

#alerts-sidebar.collapsed {
    margin-left: -380px;
}

.toggle-btn {
    position: absolute;
    right: -34px;
    top: 24px;
    width: 34px;
    height: 52px;
    background: #1e3c72;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 14px;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 3px 3px 12px rgba(0,0,0,0.15);
}

.toggle-btn:hover {
    background: #2a5298;
    transform: translateX(2px);
}

#alerts-sidebar.collapsed .toggle-btn {
    transform: rotate(180deg);
}

#alerts-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-embed {
    background-color: #fff;
    border: 2px solid #e1e8ed;
    border-left: 4px solid #1e3c72;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s;
}

.alert-embed:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.embed-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
    color: white;
}

.embed-body {
    padding: 16px;
}

.embed-body p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.embed-history {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e1e8ed;
}

.embed-history summary {
    cursor: pointer;
    user-select: none;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e3c72;
}

.embed-history summary:hover {
    color: #2a5298;
}

.history-entry {
    font-size: 0.9em;
    color: #5a6c7d;
    padding: 8px 0;
    display: grid;
    grid-template-columns: 80px 100px 1fr;
    gap: 12px;
    border-bottom: 1px solid #e1e8ed;
}

.history-entry:last-child {
    border-bottom: none;
}

#auctions-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 18px;
    align-content: start;
    padding: 24px;
    overflow-y: auto;
}

.auction-card {
    background-color: white;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 600px;
}

.auction-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
    border-color: #cbd5e0;
}

.auction-card.tracked {
    border-color: #1e3c72;
    box-shadow: 0 4px 20px rgba(30,60,114,0.2);
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
}

.auction-card.tracked:hover {
    box-shadow: 0 8px 28px rgba(30,60,114,0.25);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e1e8ed;
}

.card-header h2 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 700;
    color: #1e3c72;
}

.card-header h2 a {
    transition: color 0.2s;
}

.card-header h2 a:hover {
    color: #2a5298;
}

.card-header > div {
    display: flex;
    gap: 8px;
}

.track-auction-btn, .hide-auction-btn {
    padding: 7px 14px;
    font-size: 0.8em;
    font-weight: 600;
    border: 2px solid #e1e8ed;
    background-color: white;
    color: #5a6c7d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.track-auction-btn:hover {
    background-color: #1e3c72;
    border-color: #1e3c72;
    color: white;
    transform: translateY(-1px);
}

.auction-card.tracked .track-auction-btn {
    background-color: #1e3c72;
    border-color: #1e3c72;
    color: white;
}

.auction-card.tracked .track-auction-btn:hover {
    background-color: #2a5298;
    border-color: #2a5298;
}

.hide-auction-btn:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: translateY(-1px);
}


.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 10px 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.card-meta p {
    margin: 0;
    font-size: 0.85em;
    color: #5a6c7d;
    font-weight: 500;
}

.countdown {
    font-size: 0.85em;
    font-weight: 700;
    color: #dc3545;
    background-color: white;
    padding: 6px 12px;
    border-radius: 8px;
    border: 2px solid #ffe0e0;
}

.status-attached { color: #28a745; font-weight: 700; }
.status-detached { color: #6c757d; font-weight: 700; }
.status-error { color: #dc3545; font-weight: 700; }
.status-attaching { color: #ffc107; font-weight: 700; }

.bid-history {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px;
    margin: -4px;
}

.bid-history::-webkit-scrollbar {
    width: 8px;
}

.bid-history::-webkit-scrollbar-track {
    background: #f0f2f5;
    border-radius: 8px;
}

.bid-history::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 8px;
}

.bid-history::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.bid-entry {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}

.bid-entry:hover {
    background: white;
    border-color: #1e3c72;
    box-shadow: 0 4px 12px rgba(30,60,114,0.12);
    transform: translateX(4px);
}

.bid-amount {
    font-weight: 800;
    font-size: 1.35em;
    color: #1e3c72;
    letter-spacing: -0.5px;
}

.bid-meta {
    font-size: 0.8em;
    color: #5a6c7d;
    text-align: right;
    line-height: 1.5;
}

.bid-meta span {
    display: block;
}

.timestamp {
    grid-column: 2;
    font-size: 0.75em;
    color: #8b95a1;
    text-align: right;
    font-weight: 500;
}

.user-id {
    cursor: pointer;
    color: #1e3c72;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 1px dotted #1e3c72;
}

.user-id:hover {
    color: #2a5298;
    border-bottom-style: solid;
}

.user-id[data-id="N/A"] {
    cursor: default;
    color: #8b95a1;
    border: none;
    font-weight: normal;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 32px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    text-align: center;
}

.login-container h2 {
    margin-bottom: 24px;
    color: #1e3c72;
    font-weight: 600;
}

.login-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.2s;
    box-sizing: border-box;
}

.login-container input:focus {
    outline: none;
    border-color: #1e3c72;
    box-shadow: 0 0 0 3px rgba(30,60,114,0.1);
}

.login-container button {
    width: 100%;
    padding: 12px;
    border: none;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.2s;
}

.login-container button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30,60,114,0.3);
}

.user-tooltip {
    background: white;
    border: 2px solid #1e3c72;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    font-size: 0.85em;
    min-width: 180px;
}

.user-tooltip strong {
    display: block;
    margin-bottom: 8px;
    color: #1e3c72;
    font-size: 1.1em;
    border-bottom: 1px solid #e1e8ed;
    padding-bottom: 6px;
}

.user-tooltip div {
    padding: 3px 0;
    color: #5a6c7d;
}
