/* ===== APP BACKGROUND ===== */
body {
    background-image: url('/static/images/mtg-background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

/* Make content containers semi-transparent so background shows */
.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    width: 95% !important; /* Override Bootstrap */
    max-width: none !important; /* Remove the 1200px limit */
}

/* Ensure title doesn't wrap unnecessarily */
.card-title {
    flex: 1;
    min-width: fit-content;
}



/* Sample data button */
#sampleBtn {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    transition: all 0.2s;
	white-space: nowrap;
	flex-shrink: 0;
	margin-left: auto;
}

#sampleBtn:hover {
    background-color: #6c757d;
    color: white;
    transform: scale(1.02);
}

#sampleBtn:active {
    transform: scale(0.98);
}

/* Cards inside the app */
.card {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(5px);
    border: none !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Card hover effect */
.card .border-bottom:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

/* ===== LOGIN PAGE BACKGROUND ===== */
body.modal-open {
    overflow: hidden;
}

#authModal .modal-content {
    position: relative;
    z-index: 1002;
}

#authModal::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/images/mtg-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.7); /* Darken slightly so white modal pops */
    z-index: 1001;
}

/* Optional: Add a subtle overlay to make text more readable */
#authModal::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

/* Keep modal content above background */
#authModal .modal-content {
    position: relative;
    z-index: 1003;
}

.login-header-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    height: 20px;
    margin-right: 20px;
	line-height: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.login-header-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.login-header-btn:active {
    transform: scale(0.95);
}

/* Mana symbols 
.mana-symbols {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}*/

/* ===== MANA SYMBOLS - COMPLETE NOVEL SYSTEM ===== */
.mana-symbols {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    line-height: 1;
}

/* Base dot style */
.mana-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    position: relative;
}

/* ===== COLORED MANA DOTS ===== */
.mana-white { 
    background: #F0F0F0;
    border: 1px solid #888;  /* Grey border to distinguish */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mana-blue { background: #2A6EBB; }  /* Slightly different blue */
.mana-black { background: #1A1A1A; }  /* Pure black */
.mana-red { background: #C41E3A; }    /* Different red */
.mana-green { background: #1B7B4A; }  /* Different green */
.mana-colorless { background: #9A8C7C; }  /* Taupe/gray */

/* ===== HYBRID MANA - DIAGONAL SPLIT ===== */
.mana-hybrid-wu { 
    background: linear-gradient(135deg, #F0F0F0 50%, #2A6EBB 50%);
    border: 1px solid #666;
}
.mana-hybrid-wb { 
    background: linear-gradient(135deg, #F0F0F0 50%, #1A1A1A 50%);
    border: 1px solid #666;
}
.mana-hybrid-ub { background: linear-gradient(135deg, #2A6EBB 50%, #1A1A1A 50%); }
.mana-hybrid-ur { background: linear-gradient(135deg, #2A6EBB 50%, #C41E3A 50%); }
.mana-hybrid-br { background: linear-gradient(135deg, #1A1A1A 50%, #C41E3A 50%); }
.mana-hybrid-bg { background: linear-gradient(135deg, #1A1A1A 50%, #1B7B4A 50%); }
.mana-hybrid-rw { 
    background: linear-gradient(135deg, #C41E3A 50%, #F0F0F0 50%);
    border: 1px solid #666;
}
.mana-hybrid-rg { background: linear-gradient(135deg, #C41E3A 50%, #1B7B4A 50%); }
.mana-hybrid-gw { 
    background: linear-gradient(135deg, #1B7B4A 50%, #F0F0F0 50%);
    border: 1px solid #666;
}
.mana-hybrid-gu { background: linear-gradient(135deg, #1B7B4A 50%, #2A6EBB 50%); }

/* ===== 2/MANA HYBRID (e.g., {2/W}) - TWO DOTS STACKED ===== */
/* These use a different approach - two smaller dots */
.mana-hybrid-2w,
.mana-hybrid-2u,
.mana-hybrid-2b,
.mana-hybrid-2r,
.mana-hybrid-2g {
    position: relative;
    width: 20px;
    height: 16px;
    background: none;
}

.mana-hybrid-2w::before,
.mana-hybrid-2w::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    top: 3px;
}

.mana-hybrid-2w::before {
    left: 0;
    background: #E0E0E0;  /* Number circle color */
    border: 1px solid #888;
}

.mana-hybrid-2w::after {
    right: 0;
    background: #F0F0F0;  /* White dot */
    border: 1px solid #888;
}

/* Similar for other colors - adjust the after background */
.mana-hybrid-2u::after { background: #2A6EBB; }
.mana-hybrid-2b::after { background: #1A1A1A; }
.mana-hybrid-2r::after { background: #C41E3A; }
.mana-hybrid-2g::after { background: #1B7B4A; }

/* ===== PHYREXIAN MANA - VERTICAL LINE THROUGH DOT ===== */
.mana-phyrexian {
    position: relative;
}

/* Base colored dots */
.mana-phyrexian-white { background: #F0F0F0; border: 1px solid #666; }
.mana-phyrexian-blue { background: #2A6EBB; }
.mana-phyrexian-black { background: #1A1A1A; }
.mana-phyrexian-red { background: #C41E3A; }
.mana-phyrexian-green { background: #1B7B4A; }

/* Vertical line through all Phyrexian symbols - extends beyond dot */
.mana-phyrexian-white::after,
.mana-phyrexian-blue::after,
.mana-phyrexian-black::after,
.mana-phyrexian-red::after,
.mana-phyrexian-green::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 2.5px;
    height: 22px;
    background: currentColor;
    transform: translateX(-50%);
    border-radius: 1px;
}

/* Balanced line colors - not too dark, not too light */
.mana-phyrexian-white::after { 
    color: #666;  /* Medium grey */
    background: #666;
}
.mana-phyrexian-blue::after { 
    color: #1A2F4A;  /* Dark navy - contrasts with blue */
    background: #1A2F4A;
}
.mana-phyrexian-black::after { 
    color: #AAA;  /* Light grey on black */
    background: #AAA;
}
.mana-phyrexian-red::after { 
    color: #5C1A1A;  /* Dark burgundy - contrasts with red */
    background: #5C1A1A;
}
.mana-phyrexian-green::after { 
    color: #0A3320;  /* Deep forest - contrasts with green */
    background: #0A3320;
}

/* ===== PHYREXIAN HYBRID MANA (e.g., {G/W/P}) ===== */
.mana-phyrexian-hybrid {
    position: relative;
    width: 18px;
    height: 18px;
}

/* Base split dot for the color half */
.mana-phyrexian-hybrid-wu { background: linear-gradient(135deg, #F0F0F0 50%, #2A6EBB 50%); }
.mana-phyrexian-hybrid-wb { background: linear-gradient(135deg, #F0F0F0 50%, #1A1A1A 50%); }
.mana-phyrexian-hybrid-ub { background: linear-gradient(135deg, #2A6EBB 50%, #1A1A1A 50%); }
.mana-phyrexian-hybrid-ur { background: linear-gradient(135deg, #2A6EBB 50%, #C41E3A 50%); }
.mana-phyrexian-hybrid-br { background: linear-gradient(135deg, #1A1A1A 50%, #C41E3A 50%); }
.mana-phyrexian-hybrid-bg { background: linear-gradient(135deg, #1A1A1A 50%, #1B7B4A 50%); }
.mana-phyrexian-hybrid-rw { background: linear-gradient(135deg, #C41E3A 50%, #F0F0F0 50%); }
.mana-phyrexian-hybrid-rg { background: linear-gradient(135deg, #C41E3A 50%, #1B7B4A 50%); }
.mana-phyrexian-hybrid-gw { background: linear-gradient(135deg, #1B7B4A 50%, #F0F0F0 50%); }
.mana-phyrexian-hybrid-gu { background: linear-gradient(135deg, #1B7B4A 50%, #2A6EBB 50%); }

/* Vertical line through all Phyrexian hybrids */
.mana-phyrexian-hybrid-wu::after,
.mana-phyrexian-hybrid-wb::after,
.mana-phyrexian-hybrid-ub::after,
.mana-phyrexian-hybrid-ur::after,
.mana-phyrexian-hybrid-br::after,
.mana-phyrexian-hybrid-bg::after,
.mana-phyrexian-hybrid-rw::after,
.mana-phyrexian-hybrid-rg::after,
.mana-phyrexian-hybrid-gw::after,
.mana-phyrexian-hybrid-gu::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 2.5px;
    height: 24px;
    background: #4A4A4A;  /* Single medium-dark grey for all hybrids */
    transform: translateX(-50%);
    border-radius: 1px;
    z-index: 2;
    opacity: 0.9;
}

/* ===== NUMBERS - CIRCLE WITH BOLD NUMBER ===== */
.mana-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #E0E0E0;
    color: #1A1A1A;
    font-weight: 800;
    font-size: 0.8rem;
    line-height: 1;
    border: 1px solid #888;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* X placeholder */
.mana-number-x {
    background: #D4C9B8;
    font-style: italic;
}

/* ===== MODAL STYLES (CLEAN, SINGLE COPY) ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px;
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    padding: 10px;
    background: #f8d7da;
    border-radius: 5px;
}

/* ===== USER INFO ===== */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 60px;
}

#usernameDisplay {
    font-weight: 500;
    color: #333;
}

.logout-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.logout-btn:hover {
    background: #f0f0f0;
}

/* ===== SETTINGS GEAR ===== */
.settings-gear {
    position: relative;
    top: 0px;
    right: 15px;
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 100;
    -webkit-tap-highlight-color: transparent;
}

.settings-gear:active {
    background: #f0f0f0;
    transform: scale(0.95);
}

/* ===== CARD DISPLAY STYLES - ADDED FOR SETTINGS ===== */

/* Custom border colors for multicolor and artifact headers */
.border-multicolor, .border-start.border-multicolor {
    border-color: #aa80ff !important;
}

.border-artifact, .border-start.border-artifact {
    border-color: #8d6e63 !important;
}

/* Card type styling - can be hidden via settings */
.card-type {
    font-size: 0.85rem;
    color: #666;
    display: block;
    margin-top: 2px;
}

/* Hide type when disabled */
.card-item.hide-type .card-type {
    display: none;
}

/* Hide mana cost when disabled */
.card-item.hide-mana .mana-symbols {
    display: none;
}

/* Card content wrapper for proper flex layout */
.card-content-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0px;
    min-width: 0;
    flex-wrap: wrap;
}

/* Quantity styling */
.card-quantity {
    min-width: 30px;
    font-weight: bold;
    color: #666;
	align-items: top;
}

.card-quantity.empty-quantity {
    opacity: 0;
    pointer-events: none;
}

/* Card image tooltip */
#card-image-tooltip {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Target only the card body inside the input section */
.col-12 .card-body {
    padding: 1rem 1rem;  /* Restore padding only for this section */
}


/* ===== MOUSE POINTER DISPLAY ===== */

/* Make card name use pointer cursor (hand with finger) */
.card-name {
    cursor: pointer;
}

/* Quantity stays default - no hover, no pointer */
.card-quantity {
    cursor: default;
}

/* Prevent text selection cursor anywhere in the app */
body, 
.container, 
.card, 
.card-body,
.card-item,
.card-item * {
    cursor: default;
}

/* Only card names get the hand/pointer */
.card-name {
    cursor: pointer !important;
}

/* Keep the input/textarea as text selection cursor since you type there */
textarea, input {
    cursor: text;
}

/* Buttons should keep their default pointer */
button, .btn, .settings-gear, .login-header-btn, .logout-btn {
    cursor: pointer;
}
/* ===== END OF MOUSE POINTER DISPLAY ===== */

/* ===== MOBILE OPTIMIZATIONS (CONSOLIDATED) ===== */
/* Desktop: 50% width with auto margins */
@media (min-width: 992px) {
    .container {
        width: 50% !important;
        max-width: 800px !important; /* Prevents it from getting too wide on ultra-wide screens */
        margin-left: auto !important;
        margin-right: auto !important;
    }
    #cardInput {
        height: 400px; /* Slightly shorter since container is narrower */
    }
}

/* Tablet: Slightly wider but still centered */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        width: 70%;
        max-width: none;
    }
}

/* Mobile: Keep original behavior (almost full width) */
@media (max-width: 576px) {
    .mana-symbols {
        padding: 6px 12px;
        font-size: 1rem;
    }
    
    .badge {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .fs-5 {
        font-size: 1.25rem !important;
    }
    
    button, .btn {
        min-height: 48px;
        font-size: 1.1rem !important;
    }
}

@media (max-width: 768px) {
	/* Fix for mobile overscroll background distortion */
    html, body {
        height: 100%;
        overflow-x: hidden;
    }
	
	.body {
		background-image: none !important;
        position: fixed;  /* Change from relative to fixed */
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: scroll;  /* Enable scrolling */
        -webkit-overflow-scrolling: touch;  /* Smooth iOS scrolling */
	}
	
	body::before {
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
        bottom: 0;
        background-image: url('/static/images/mtg-background.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        z-index: -1;
	}
	
	/* Ensure content stays above the fixed background */
    .container {
        position: relative;
        z-index: 1;
        min-height: 100%;  /* Take full height */
        margin: 0 auto;
        padding: 20px;lative;
        z-index: 1;
    }
	
	.container {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
    }
	
    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 85vh;
    }
    
    .form-group input {
        font-size: 16px;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        width: 100%;
        padding: 14px;
    }
	
	.login-header-btn {
        height: 21px !important;
        line-height: 21px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        min-height: unset !important; /* Override any mobile min-height */
    }
	
/* Mobile touch improvements */	
	    .card-item {
        cursor: pointer;
    }
    
    .card-item:active {
        background-color: rgba(0,0,0,0.05);
    }
}

/* ===== END OF MOBILE OPTIMIZATIONS (CONSOLIDATED) ===== */
