:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #4fc3dc;
    --background-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #6c757d;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 20px;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.app-header {
    text-align: center;
    margin-bottom: 30px;
    color: var(--secondary-color);
}

h1, h2, h3 {
    margin-bottom: 15px;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.error {
    background-color: #ff4d4f;
}

.notification.success {
    background-color: #52c41a;
}

.notification.info {
    background-color: var(--primary-color);
}

#notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 350px;
    text-align: center;
    pointer-events: none;
}

#notification.visible {
    opacity: 1;
    transform: translateY(0);
}

#notification.success {
    background-color: #4caf50;
}

#notification.error {
    background-color: #f44336;
}

#notification.info {
    background-color: #2196f3;
}

#notification.warning {
    background-color: #ff9800;
    color: #333;
}

/* Animation for notification */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    font-size: 14px;
    margin: 5px;
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn.primary {
    background-color: var(--accent-color);
}

.btn.danger {
    background-color: #f44336;
    white-space: nowrap;
    overflow: visible;
    padding: 8px 20px;
    min-width: 150px;
    text-align: center;
    box-sizing: border-box;
}

.btn.danger:hover {
    background-color: #c82333;
}

/* Disabled button state */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading animation for disabled buttons */
.btn:disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Card Pack */
.card-pack {
    width: 120px;
    height: 180px;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    border-radius: var(--border-radius);
    margin: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card-pack:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.card-pack::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    transition: var(--transition);
}

.card-pack:hover::before {
    left: 100%;
}

/* Timer */
.timer {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timer-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.timer-actions .btn {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    margin: 0;
}

.open-now-btn {
    background-color: #4caf50;
    color: white;
    border: none;
}

.open-now-btn:hover {
    background-color: #3e8e41;
    transform: translateY(-2px);
}

.timer-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.timer-duration {
    font-weight: bold;
}

.timer-status {
    font-size: 0.9em;
    color: var(--text-light);
}

.timer-progress {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    border-radius: 5px;
    transition: width 0.5s linear;
}

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Collection */
.collection-container {
    margin-top: 0;
    padding: 0 15px;
}

/* Remove space between sections */
.timers-section {
    margin-bottom: 0;
    padding: 15px 15px 0;
    background: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin: 0 15px;
    box-shadow: var(--box-shadow);
    border: 1px solid #eee;
    border-bottom: none;
}

.collection-section {
    margin-top: -20px; /* Pull the collection section up */
    padding-top: 0;
}

.collection-stats {
    background: white;
    padding: 15px 20px 20px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin: 0;
    box-shadow: var(--box-shadow);
    border: 1px solid #eee;
    border-top: none;
}

.collection-stats h3 {
    color: var(--secondary-color);
    font-size: 1.4em;
    margin: 0;
    padding: 0;
}

.collection-stats .btn {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 0.9em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-box {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #eee;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.stat-box div:first-child {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-box div:last-child {
    color: var(--text-light);
    font-size: 0.9em;
}

.type-stats h4 {
    color: var(--secondary-color);
    margin: 25px 0 15px;
    font-size: 1.2em;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.type-box {
    background: #f9f9f9;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.type-box:hover {
    background: #f0f4f8;
    transform: translateX(3px);
}

.type-box span:last-child {
    background: var(--primary-color);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 0;
    padding: 10px 0 40px;
}

.action-section {
    text-align: center;
    margin: 30px 0;
}

.action-section .btn {
    font-size: 1.2em;
    padding: 12px 30px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.action-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    pointer-events: auto;
}

.modal.show .modal-content {
    transform: translateY(0);
}

/* Body scroll lock when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.slider-container {
    margin: 20px 0;
}

input[type="range"] {
    width: 100%;
    margin: 15px 0;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
    font-size: 14px;
}

.bonus-info {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-light);
    text-align: center;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    gap: 10px;
}

#open-now-btn {
    background-color: #4caf50;
}

#open-now-btn:hover {
    background-color: #3e8e41;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .card-pack {
        width: 100px;
        height: 150px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ===== Card Styles ===== */
.card {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    border: none;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6e8efb, #a777e3);
}

.card.gold {
    border: 2px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.card.blue {
    border: 2px solid #4fc3dc;
    box-shadow: 0 0 10px rgba(79, 195, 220, 0.3);
}

.card.grey {
    border: 2px solid #cccccc;
}

.card-inner {
    padding: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.card-rarity {
    font-size: 0.7em;
    font-weight: bold;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    color: white;
}

.card-rarity.gold {
    background: linear-gradient(135deg, #ffd700, #ffa500);
}

.card-rarity.blue {
    background: linear-gradient(135deg, #4fc3dc, #6e8efb);
}

.card-rarity.grey {
    background: linear-gradient(135deg, #cccccc, #999999);
}

.card-type {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 16px;
    font-style: italic;
}

.card-stats {
    margin: 16px 0;
}

.stat {
    margin-bottom: 12px;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85em;
    color: #555;
    font-weight: 500;
}

.primary-stat .stat-label {
    font-weight: bold;
    color: #2c3e50;
}

.stat-bar-container {
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
}

.stat-bar {
    height: 100%;
    background: linear-gradient(90deg, #6e8efb, #a777e3);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.primary-stat .stat-bar {
    background: linear-gradient(90deg, #4fc3dc, #6e8efb);
}

.stat-value {
    font-size: 0.9em;
    font-weight: bold;
    color: #2c3e50;
}

.card-flavor {
    font-style: italic;
    color: #666;
    font-size: 0.85em;
    margin: 16px 0;
    padding: 8px 0;
    border-top: 1px dashed #ddd;
    border-bottom: 1px dashed #ddd;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: #888;
    margin-top: 12px;
}

/* Pack view styles */
.card-pack {
    width: 180px;
    height: 250px;
    perspective: 1000px;
    margin: 10px;
    cursor: pointer;
}

.card-pack-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-pack:hover .card-pack-inner {
    transform: rotateY(180deg);
}

.card-pack-content {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
}

.card-pack:nth-child(2n) .card-pack-content {
    background: linear-gradient(135deg, #4fc3dc, #6e8efb);
}

.card-pack:nth-child(3n) .card-pack-content {
    background: linear-gradient(135deg, #a777e3, #4fc3dc);
}

.card-pack-rarity {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.card-pack-rarity.gold {
    background: linear-gradient(135deg, #ffd700, #ffa500);
}

.card-pack-rarity.blue {
    background: linear-gradient(135deg, #4fc3dc, #6e8efb);
}

.card-pack-rarity.grey {
    background: linear-gradient(135deg, #cccccc, #999999);
}

.card-pack h3 {
    margin: 10px 0;
    font-size: 1.1em;
}

.card-pack p {
    font-size: 0.9em;
    margin-bottom: 15px;
}

.card-pack-stats {
    width: 100%;
    margin-top: auto;
}

.card-pack-stats .stat {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 0.9em;
}

.card-pack-stats .stat-label {
    color: rgba(255, 255, 255, 0.8);
}

.card-pack-stats .stat-value {
    color: white;
    font-weight: bold;
}
