/* Base Styles - Import Foundation Files */
@import url('styles/base/variables.css');
@import url('styles/base/reset.css');

/* Layout Components */
@import url('styles/layout/container.css');
@import url('styles/layout/header.css');
@import url('styles/layout/footer.css');

/* Card Display Components */
@import url('styles/components/card-views.css');
@import url('styles/components/loading-states.css');
@import url('styles/components/card-modal.css');
@import url('styles/components/profile-modal.css');

/* Page-Specific Styles */
@import url('styles/pages/admin-page.css');
@import url('styles/pages/creators-page.css');

/* Search and Filter Section */
.search-filter-section {
    background: white;
    padding: 25px 25px 0 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
    margin-bottom: 15px;
}

.search-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-btn {
    padding: 12px 25px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: #2980b9;
}

.filter-toggle-btn {
    padding: 12px 20px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-toggle-btn:hover {
    background-color: #7f8c8d;
}

.filter-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
    margin-top: 15px;
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.filter-select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #3498db;
}

.clear-btn, .toggle-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.clear-btn {
    background-color: #e74c3c;
    color: white;
}

.clear-btn:hover {
    background-color: #c0392b;
}

.toggle-btn {
    background-color: #f39c12;
    color: white;
}

.toggle-btn:hover {
    background-color: #e67e22;
}

.toggle-btn.active {
    background-color: #27ae60;
}

.toggle-btn.active:hover {
    background-color: #229954;
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

#resultsCount {
    font-weight: 600;
    color: #555;
}

.view-options {
    display: flex;
    gap: 15px;
}

.view-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 14px;
}

/* Responsive Design */
/* Tablet/Medium screens - 4 cards per row on 1024px screens */
@media (max-width: 1280px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .search-container {
        flex-direction: row;
        gap: 5px;
        flex-wrap: nowrap;
    }

    .search-input {
        flex: 1;
        min-width: 0;
        padding: 10px;
        font-size: 14px;
    }

    .search-btn {
        padding: 10px 12px;
        white-space: nowrap;
        font-size: 14px;
        flex-shrink: 0;
    }

    .filter-toggle-btn {
        padding: 10px 12px;
        flex-shrink: 0;
    }

    .filter-container {
        grid-template-columns: 1fr;
    }
    
    .results-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hide stats on mobile to simplify card display */
    .card-grid .card-stats {
        display: none;
    }
    
    .card-grid.list-view .card-item {
        flex-direction: column;
        text-align: center;
    }
    
    .card-grid.list-view .card-image {
        margin-right: 0;
        margin-bottom: 15px;
        width: 160px;
        height: 224px; /* 160px * (88/63) = proper aspect ratio height */
    }
    
    .text-view-table {
        font-size: 12px;
        min-width: 100%;
    }

    .text-view-table th,
    .text-view-table td {
        padding: 6px 4px;
    }

    .text-view-table .card-name {
        max-width: none;
    }

    /* Hide all columns except card number, card name, and price on mobile */
    .text-view-table th:not(:nth-child(1)):not(:nth-child(2)):not(:last-child),
    .text-view-table td:not(:nth-child(1)):not(:nth-child(2)):not(:last-child) {
        display: none;
    }
}

/* Standardized Page Header - Used by all pages */
.page-header {
    position: relative;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background: white;
    color: #2c3e50;
    border-radius: var(--border-radius-lg);
    border: 1px solid #e1e8ed;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.page-header h1 {
    margin: 0 0 var(--spacing-sm) 0;
    font-size: var(--font-size-4xl);
    font-weight: 600;
    color: #2c3e50;
}

.page-description {
    font-size: var(--font-size-lg);
    margin: 0;
    color: #666;
    opacity: 1;
}

/* Page actions positioned in lower right */
.page-actions {
    position: absolute;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Page header with actions layout */
.page-header.with-actions {
    min-height: 120px;
    padding-bottom: calc(var(--spacing-xl) + 50px); /* Extra space for actions */
}

/* Standardized Filter Section */
.search-filter-section, .deck-filters, .filter-container {
    background: var(--filter-bg);
    padding: var(--filter-padding);
    margin-bottom: var(--spacing-xl);
}

.search-container {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.search-input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-base);
}

.search-btn, .btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-color);
    border: none;
    border-radius: 0 !important; /* Force remove any rounded corners */
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;

    /* Remove all shadows for flat appearance */
    box-shadow: none;

    /* Sharp beveled corners - cut off top-left and bottom-right */
    clip-path: polygon(
        10px 0%,       /* Start 10px from top-left */
        100% 0%,       /* Top edge */
        100% calc(100% - 10px), /* Right edge to 10px before bottom-right */
        calc(100% - 10px) 100%, /* Bottom edge starting 10px from bottom-right */
        0% 100%,       /* Bottom-left corner (normal) */
        0% 10px        /* Left edge starting 10px from top-left */
    ) !important;
}

.search-btn:hover, .btn-primary:hover {
    background: var(--btn-primary-bg-hover);
    box-shadow: none;
    transform: none;
}

.search-btn:active, .btn-primary:active {
    background: var(--btn-primary-bg-hover);
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-color);
    border: none;
    border-radius: 0 !important; /* Force remove any rounded corners */
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;

    /* Remove all shadows for flat appearance */
    box-shadow: none;

    /* Sharp beveled corners - cut off top-left and bottom-right */
    clip-path: polygon(
        10px 0%,       /* Start 10px from top-left */
        100% 0%,       /* Top edge */
        100% calc(100% - 10px), /* Right edge to 10px before bottom-right */
        calc(100% - 10px) 100%, /* Bottom edge starting 10px from bottom-right */
        0% 100%,       /* Bottom-left corner (normal) */
        0% 10px        /* Left edge starting 10px from top-left */
    ) !important;
}

.btn-secondary:hover {
    background: var(--btn-secondary-bg-hover);
    box-shadow: none;
    transform: none;
}

.btn-secondary:active {
    background: var(--btn-secondary-bg-hover);
    box-shadow: none;
    transform: none;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-width: 200px;
}

.filter-group label {
    font-weight: 500;
    color: var(--color-secondary);
    font-size: var(--font-size-sm);
}

.filter-select {
    padding: var(--spacing-sm);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-base);
    background: var(--color-white);
}

@media (max-width: 768px) {
    .page-header {
        padding: 30px 15px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .coming-soon {
        padding: 40px 20px;
        margin: 0 15px;
    }

    .coming-soon-icon {
        font-size: 3rem;
    }
}

.auth-required-message {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
    border: 1px solid #e1e8ed;
}

.auth-card h2 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.8rem;
}

.auth-card p {
    margin: 0 0 30px 0;
    color: #6c757d;
    font-size: 1.1rem;
    line-height: 1.5;
}

.auth-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-actions .btn-primary,
.auth-actions .btn-secondary {
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.auth-actions .btn-primary {
    background: #5865f2;
    color: white;
}

.auth-actions .btn-primary:hover {
    background: #4752c4;
}

.auth-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.auth-actions .btn-secondary:hover {
    background: #5a6268;
}

@media (max-width: 768px) {
    .auth-card {
        padding: 30px 20px;
        margin: 0 10px;
    }

    .auth-actions {
        flex-direction: column;
    }

    .auth-actions .btn-primary,
    .auth-actions .btn-secondary {
        width: 100%;
    }
}

/* Reset Collection and Danger Zone Styles */
.danger-zone {
    margin-top: 30px;
    padding: 20px;
    border: 2px solid var(--color-error);
    border-radius: 8px;
    background-color: rgba(231, 76, 60, 0.05);
}

.danger-zone h3 {
    color: var(--color-error);
    margin: 0 0 10px 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.danger-zone h3::before {
    content: "⚠️";
    font-size: var(--font-size-xl);
}

.danger-zone p {
    color: var(--color-gray-700);
    margin: 0 0 15px 0;
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-error) 0%, #c0392b 100%);
    color: var(--color-white);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    clip-path: polygon(10px 0%, 100% 0%, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0% 100%, 0% 10px);
    box-shadow: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
    background: linear-gradient(135deg, #a93226 0%, #922b21 100%);
}

/* Reset Collection Confirmation Modal */
.reset-confirmation-modal .modal-content {
    max-width: 500px;
    border: 2px solid var(--color-error);
}

.reset-confirmation-modal .modal-header {
    background-color: rgba(231, 76, 60, 0.1);
    border-bottom: 1px solid var(--color-error);
}

.reset-confirmation-modal .modal-header h3 {
    color: var(--color-error);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.reset-confirmation-modal .modal-header h3::before {
    content: "⚠️";
    font-size: var(--font-size-xl);
}

.reset-warning {
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--color-error);
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
}

.reset-warning p {
    margin: 0 0 10px 0;
    color: var(--color-gray-800);
    font-weight: 500;
}

.reset-warning p:last-child {
    margin: 0;
    color: var(--color-error);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.confirmation-input-group {
    margin: 20px 0;
}

.confirmation-input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-gray-700);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.confirmation-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--color-gray-300);
    border-radius: 5px;
    font-size: var(--font-size-base);
    font-family: monospace;
    transition: border-color 0.3s ease;
}

.confirmation-input:focus {
    outline: none;
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.confirmation-input.valid {
    border-color: var(--color-success);
    background-color: rgba(39, 174, 96, 0.05);
}

.reset-confirmation-modal .modal-footer {
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid var(--color-gray-200);
}

.reset-confirmation-modal .modal-footer .btn-secondary {
    background: var(--color-gray-500);
    color: var(--color-white);
}

.reset-confirmation-modal .modal-footer .btn-secondary:hover {
    background: var(--color-gray-600);
}

.reset-confirmation-modal .modal-footer .btn-danger:disabled {
    background: var(--color-gray-400);
    cursor: not-allowed;
    opacity: 0.6;
}

.reset-confirmation-modal .modal-footer .btn-danger:disabled:hover {
    background: var(--color-gray-400);
    transform: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .danger-zone {
        margin-top: 20px;
        padding: 15px;
    }

    .danger-zone h3 {
        font-size: var(--font-size-base);
    }

    .reset-confirmation-modal .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .reset-confirmation-modal .modal-footer {
        flex-direction: column;
        gap: 10px;
    }

    .reset-confirmation-modal .modal-footer .btn-secondary,
    .reset-confirmation-modal .modal-footer .btn-danger {
        width: 100%;
    }
}

/* Deck Favorites Styles */
.btn-favorite {
    background: linear-gradient(135deg, var(--color-gray-100) 0%, var(--color-gray-200) 100%);
    color: var(--color-gray-700);
    border: 2px solid var(--color-gray-300);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    clip-path: polygon(10px 0%, 100% 0%, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0% 100%, 0% 10px);
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-favorite:hover {
    background: linear-gradient(135deg, var(--color-gray-200) 0%, var(--color-gray-300) 100%);
    border-color: var(--color-gray-400);
    transform: translateY(-1px);
}

.btn-favorite.favorited {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: var(--color-white);
    border-color: #ff6b6b;
}

.btn-favorite.favorited:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #dc4545 100%);
    border-color: #ee5a52;
}

.btn-favorite .favorite-icon {
    font-size: var(--font-size-lg);
    transition: transform 0.2s ease;
}

.btn-favorite.favorited .favorite-icon::before {
    content: "♥";
}

.btn-favorite:not(.favorited) .favorite-icon::before {
    content: "♡";
}

.btn-favorite:hover .favorite-icon {
    transform: scale(1.1);
}

/* Deck card favorite indicators */
.deck-card .favorite-count {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-gray-600);
    font-size: var(--font-size-xs);
}

.deck-card .favorite-count .heart {
    color: #ff6b6b;
}

.deck-card.favorited {
    position: relative;
}

.deck-card.favorited::before {
    content: "♥";
    position: absolute;
    top: 8px;
    right: 8px;
    color: #ff6b6b;
    font-size: var(--font-size-lg);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 10;
}

/* Trading Lists Controls (ISO/WTT) */
.modal-trading-section {
    margin-top: 0px;
}

.trading-controls-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.trading-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.trading-buttons-compact {
    display: flex;
    gap: 8px;
}

.trading-compact-btn {
    padding: 6px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

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

.trading-compact-btn.active-iso {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.trading-compact-btn.active-wtt {
    background: #e67e22;
    color: white;
    border-color: #e67e22;
}

/* ========================================
   CARD PRICE DISPLAY STYLES
   ======================================== */

/* Price display in list/grid view cards */
.card-price-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-gray-200);
}

.card-price-info .price-label {
    font-size: var(--font-size-sm);
    color: var(--color-gray-600);
    font-weight: 600;
}

.card-price-info .price-value {
    font-size: var(--font-size-base);
    color: var(--color-success);
    font-weight: 700;
}

.card-price-info .price-link {
    font-size: var(--font-size-base);
    color: var(--color-success);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.card-price-info .price-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Price display in text view table */
.text-view-table .card-price {
    text-align: center;
    font-weight: 600;
}

.text-view-table .price-link {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.text-view-table .price-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Sort options styling */
.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-options label {
    font-weight: 600;
    color: var(--color-secondary);
}

.sort-select {
    padding: 6px 10px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-sm);
    background: var(--color-white);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.sort-direction-btn {
    padding: 6px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius-md);
    background: var(--color-white);
    font-size: var(--font-size-lg);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-direction-btn:hover {
    background: var(--color-gray-100);
    border-color: var(--color-primary);
}

.sort-direction-btn:active {
    transform: scale(0.95);
}