/* 
 * Shared Page Styles for WheresMyPokeFriend.com
 * Used by browse.php, browse-trades.php, post-trade.php, commit-trade.php
 */

/* === DARK THEME BASE === */
body.dark-page {
    background: #0f1419;
    color: #fff;
}

body.dark-page .container {
    background: transparent;
}

body.dark-page main.container h1 {
    color: #fff;
}

/* === CARD BACKGROUNDS === */
.card-dark {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 30px;
}

.card-darker {
    background: #16213e;
    border-radius: 8px;
    padding: 20px;
}

/* === TABS === */
.tabs {
    display: flex;
    gap: 0;
    background: #1a1a2e;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    margin: 20px 0 0 0;
}

.tab {
    flex: 1;
    padding: 15px 20px;
    text-align: center;
    background: #16213e;
    color: #aaa;
    cursor: pointer;
    border: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    font-family: inherit;
}

.tab:hover {
    background: #1a1a2e;
    color: #fff;
}

.tab.active {
    background: #ff6b35;
    color: #fff;
}

.tab-content {
    background: #1a1a2e;
    padding: 30px;
    border-radius: 0 0 8px 8px;
    min-height: 400px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* === TRADE CARDS === */
.trade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.trade-card {
    background: #16213e;
    border-radius: 8px;
    padding: 18px;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trade-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.3);
}

/* Horizontal layout for offering and seeking sections */
.trade-sections-horizontal {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.trade-sections-horizontal .trade-section {
    flex: 1;
    min-width: 0; /* Allow flex items to shrink */
}

.trade-sections-horizontal .trade-arrow {
    align-self: center;
    font-size: 24px;
    padding: 0 5px;
}

.trade-location {
    color: #ff6b35;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trade-section {
    margin: 8px 0;
}

.trade-label {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 6px;
}

/* === POKEMON DISPLAY === */
.pokemon-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.pokemon-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0f1419;
    padding: 8px 12px;
    border-radius: 6px;
}

.pokemon-item img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
}

.pokemon-item span {
    font-weight: bold;
    color: #fff;
}

.pokemon-mini {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #0f1419;
    padding: 5px 10px;
    border-radius: 5px;
}

.pokemon-mini img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

.pokemon-mini span {
    font-size: 13px;
    color: #fff;
}

.pokemon-name {
    font-size: 13px;
    color: #fff;
    font-weight: 600;
    text-align: center;
}

/* === DESCRIPTIONS === */
.description-text,
.description-box {
    color: #ccc;
    font-style: italic;
    font-size: 13px;
    padding: 10px 15px;
    background: #0f1419;
    border-radius: 5px;
}

.description-box {
    border-left: 3px solid #ff6b35;
}

/* === TRADE ARROW === */
.trade-arrow {
    text-align: center;
    font-size: 32px;
    color: #ff6b35;
    margin: 15px 0;
}

/* === BADGES === */
.trade-attributes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
    margin: 5px 5px 5px 0;
}

.badge.shiny {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.badge.dynamax {
    background: linear-gradient(135deg, #9C27B0, #E91E63);
    color: #fff;
}

.badge.xxl {
    background: #2196F3;
    color: #fff;
}

.badge.xxs {
    background: #009688;
    color: #fff;
}

/* === TRADE META === */
.trade-meta {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #0f1419;
}

.trade-details {
    width: 100%;
    margin-top: 10px;
}

/* === BUTTONS === */
.commit-btn {
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    margin-top: auto;
}

.commit-btn:hover {
    background: #45a049;
}

.submit-btn {
    background: #ff6b35;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #e55a2b;
}

.submit-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

.post-trade-btn {
    background: #ff6b35;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
    display: inline-block;
    text-decoration: none;
}

.post-trade-btn:hover {
    background: #e55a2b;
}

.add-pokemon-btn {
    background: #4CAF50;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 5px;
}

.add-pokemon-btn:hover {
    background: #45a049;
}

.add-pokemon-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

.remove-pokemon-btn {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.remove-pokemon-btn:hover {
    background: #b71c1c;
}

/* === LINKS === */
.back-link {
    display: inline-block;
    color: #ffeb3b;
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* === FORMS === */
.trade-form,
.commit-form {
    background: #1a1a2e;
    padding: 30px;
    border-radius: 8px;
    max-width: 900px;
    margin: 20px auto;
}

.commit-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.trade-preview {
    background: #1a1a2e;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.trade-preview h2,
.trade-form h1 {
    color: #fff;
}

.commit-form h2 {
    color: #4CAF50;
    margin-bottom: 20px;
}

.form-section {
    background: #16213e;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-section h3 {
    color: #ff6b35;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: #0f1419;
    border: 1px solid #444;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-note {
    font-size: 13px;
    color: #888;
    margin-top: 5px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.checkbox-item label {
    margin: 0;
    color: #ccc;
}

.required {
    color: #ff6b35;
}

.note {
    background: #0f1419;
    padding: 15px;
    border-left: 4px solid #ff6b35;
    color: #ccc;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 14px;
}

.thank-you-note {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #4CAF50;
}

.thank-you-note h3 {
    margin-top: 0;
    color: #1b5e20;
}

/* === POKEMON AUTOCOMPLETE === */
.pokemon-selector {
    margin-bottom: 20px;
}

.pokemon-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.autocomplete-wrapper {
    flex: 1;
    position: relative;
}

.pokemon-search {
    width: 100%;
    padding: 10px 10px 10px 45px;
    background: #0f1419;
    border: 1px solid #444;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
}

.pokemon-sprite-preview {
    width: 32px;
    height: 32px;
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    image-rendering: pixelated;
    display: none;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0f1419;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-bottom: 1px solid #222;
}

.autocomplete-item:hover {
    background: #16213e;
}

.autocomplete-item img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

.autocomplete-item .name {
    flex: 1;
    color: #fff;
}

.autocomplete-item .evolution {
    font-size: 11px;
    color: #888;
}

/* === BROWSE PAGE SPECIFIC === */
.browse-container {
    position: relative;
}

.browse-main {
    display: flex;
    gap: 20px;
    margin-top: 0;
    align-items: flex-start;
}

.browse-left {
    flex: 0 0 60%;
    min-width: 0;
}

.right-sidebar {
    flex: 0 0 40%;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}

/* Browse page has larger Pokemon display */
.browse-left .pokemon-item {
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.browse-left .pokemon-item img {
    width: 80px;
    height: 80px;
}

.evolution-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #888;
}

/* Browse page trade cards have different layout */
.browse-left .trade-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

/* Horizontal layout for offering and seeking sections */
.browse-left .trade-sections-horizontal {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.browse-left .trade-sections-horizontal .trade-section {
    flex: 1;
    min-width: 0; /* Allow flex items to shrink */
}

.browse-left .trade-sections-horizontal .trade-arrow {
    align-self: center;
    font-size: 32px;
    color: #ff6b35;
    min-width: auto;
    padding: 0 10px;
    flex-shrink: 0;
}

/* === FILTERS === */
.filters {
    background: #1a1a2e;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    background: #16213e;
    border: 1px solid #444;
    border-radius: 5px;
    color: #fff;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
    .browse-main {
        flex-direction: column;
    }
    
    .right-sidebar {
        position: static !important;
        width: 100% !important;
        height: 400px !important;
    }
    
    .trade-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    /* Stack trade sections vertically on mobile */
    .trade-sections-horizontal,
    .browse-left .trade-sections-horizontal {
        flex-direction: column;
        gap: 8px;
    }
    
    .trade-sections-horizontal .trade-arrow,
    .browse-left .trade-sections-horizontal .trade-arrow {
        align-self: center;
        transform: rotate(90deg); /* Rotate arrow back to vertical */
    }
}
