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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1f2937;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user span {
    color: #6b7280;
    font-weight: 500;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 200px);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.top-bar {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.top-bar .nav-links {
    display: flex;
    gap: 1.5rem;
}

.top-bar .nav-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.top-bar .nav-links a:hover {
    color: #5568d3;
}

.top-bar .login-btn {
    background-color: #667eea;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.top-bar .login-btn:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
}

.main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    gap: 2rem;
}

.login-card {
    flex: 2;
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-card h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.login-card > p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.summary-section {
    background-color: #f0f9ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.summary-section h3 {
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.summary-section p {
    color: #374151;
    line-height: 1.6;
}

.invite-link {
    margin-top: 1rem;
    font-weight: 600;
}

.invite-link a {
    color: #667eea;
    text-decoration: none;
}

.invite-link a:hover {
    color: #5568d3;
    text-decoration: underline;
}

.info-section {
    margin-top: 1.5rem;
}

.info-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.info-section ul {
    list-style: none;
    color: #6b7280;
    font-size: 0.95rem;
    padding-left: 0;
}

.info-section li {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.info-section li:before {
    content: "✓ ";
    color: #10b981;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.update-pane {
    flex: 1;
    background-color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow-y: auto;
    max-height: 600px;
}

.update-pane h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #1f2937;
}

.update-pane ul {
    list-style: none;
    padding-left: 0;
}

.update-pane li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.update-pane li:last-child {
    border-bottom: none;
}

.update-pane strong {
    color: #667eea;
}

/* Buttons - Improved with outlines and high contrast */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: #667eea;
    color: white;
    border-color: #5568d3;
}

.btn-primary:hover {
    background: #5568d3;
    border-color: #4551b6;
}

.btn-secondary {
    background: white;
    color: #374151;
    border-color: #d1d5db;
    text-shadow: none;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-discord {
    background: #5865F2;
    color: white;
    border-color: #4752C4;
    width: 100%;
    justify-content: center;
}

.btn-discord:hover {
    background: #4752C4;
    border-color: #3c44a4;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border-color: #dc2626;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #b91c1c;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-width: 2px;
}

/* Dashboard */
.dashboard {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.dashboard-header h2 {
    font-size: 2rem;
}

.section {
    margin: 2rem 0;
}

.section h3 {
    margin-bottom: 1rem;
    color: #374151;
}

/* Deck Grid */
.deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.deck-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.deck-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.deck-meta {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.deck-actions {
    display: flex;
    gap: 0.5rem;
}

/* Server List */
.server-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.server-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.server-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.server-icon-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.deck-assigned {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.no-deck {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.assign-form {
    display: flex;
    gap: 0.5rem;
}

.deck-select {
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.9rem;
    appearance: none;
    background-color: white;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.deck-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Forms */
.form-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.deck-form, .card-form, .rarity-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group select {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
    cursor: pointer;
}

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

.form-info {
    background: #f3f4f6;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.form-info h4 {
    margin-bottom: 0.5rem;
}

.form-info ul {
    margin-left: 1.5rem;
    color: #6b7280;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Cards List */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-preview {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.card-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.card-thumbnail-placeholder {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    border-radius: 6px;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.card-details h4 {
    margin-bottom: 0.25rem;
}

.card-rarity-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #667eea;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: normal;
}

.card-description {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.card-specs {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Rarity Form */
.rarity-info {
    background: #f3f4f6;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.total-display {
    font-size: 1.25rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.rarity-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.input-with-suffix {
    position: relative;
}

.input-with-suffix input {
    padding-right: 2rem;
}

.input-with-suffix .suffix {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 3rem;
    font-style: italic;
}

/* Merge Perks */
.info-text {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.info-box {
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.merge-perks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.perk-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.perk-info {
    flex: 1;
}

.perk-info h5 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.1rem;
}

.perk-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 0.5rem;
}

.perk-stat {
    font-size: 0.9rem;
    color: #6b7280;
}

.perk-stat strong {
    color: #3b82f6;
}

.perk-preview {
    color: #6b7280;
    font-size: 0.85rem;
}

/* Edit Deck Header */
.deck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-deck-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: white;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .deck-grid {
        grid-template-columns: 1fr;
    }
    
    .server-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .assign-form {
        width: 100%;
        margin-top: 1rem;
    }
    
    .deck-select {
        flex: 1;
    }
}
