/* jrBattle module CSS - starter for tabs */
.jr-tabs { margin: 20px 0; }
.jr-tabs-nav { list-style: none; padding: 0; display: flex; border-bottom: 1px solid #ccc; }
.jr-tabs-nav li { margin: 0; }
.jr-tabs-nav a { display: block; padding: 10px 20px; text-decoration: none; color: #333; border: 1px solid #ccc; border-bottom: none; background: #f9f9f9; margin-right: 2px; border-radius: 5px 5px 0 0; }
.jr-tabs-nav a.jr-tab-active { background: #fff; font-weight: bold; color: #222; border-bottom: 1px solid #fff; }
.jr-tab-panel { display: none; padding: 20px; background: #fff; border: 1px solid #ccc; border-top: none; }

.jr-sub-tabs-nav { list-style: none; padding: 0; display: flex; border-bottom: 1px solid #eee; margin-bottom: 10px; }
.jr-sub-tabs-nav li { margin: 0; }
.jr-sub-tabs-nav a { display: block; padding: 6px 14px; text-decoration: none; color: #555; border: 1px solid #eee; border-bottom: none; background: #f5f5f5; margin-right: 2px; border-radius: 4px 4px 0 0; }
.jr-sub-tabs-nav a.jr-sub-tab-active { background: #e9e9e9; font-weight: bold; color: #222; border-bottom: 1px solid #e9e9e9; }

/* General Typography */
.jr-container h1, .jr-modal-content h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

/* Loading and error states */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.loading:before {
    content: "⟳";
    display: inline-block;
    font-size: 24px;
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.error {
    text-align: center;
    padding: 40px 20px;
    color: #d9534f;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    border-radius: 4px;
    margin: 10px 0;
}

.error:before {
    content: "⚠";
    display: inline-block;
    font-size: 24px;
    margin-right: 10px;
}

/* Analytics Styles */
.jr-analytics-stats {
    margin-bottom: 30px;
}

.jr-analytics-stats h3 {
    margin-bottom: 20px;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #007cba;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.jr-analytics-activity h3 {
    margin-bottom: 15px;
    color: #333;
}

.jr-analytics-list {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
}

.jr-analytic-item {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 15px;
}

.jr-analytic-item:last-child {
    border-bottom: none;
}

.jr-analytic-timestamp {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
}

.jr-analytic-message {
    flex: 1;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .jr-analytic-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Arena Styles */
.jr-arena-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.jr-arena-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.jr-arena-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.jr-arena-media {
    margin-bottom: 15px;
}

.jr-arena-media h4 {
    margin: 10px 0 5px 0;
    font-size: 1.1rem;
}

.jr-arena-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

.jr-arena-info {
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.jr-arena-profile {
    margin-bottom: 10px;
}

.jr-arena-profile a {
    font-weight: bold;
    text-decoration: none;
}

.jr-elo-rating {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.9rem;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
}

.jr-challenge-btn {
    width: 100%;
    margin-top: 10px;
}

.jr-your-media {
    display: inline-block;
    color: #666;
    font-style: italic;
    font-size: 0.9rem;
}

/* Modal Styles */
.jr-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.jr-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.jr-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
}

.jr-modal-close:hover,
.jr-modal-close:focus {
    color: #000;
    text-decoration: none;
}

#jr-challenge-form-content {
    padding: 20px;
}

/* Challenge Form Styles */
.jr-challenge-form {
    background: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.jr-challenge-form h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}
.jr-challenge-form h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 12px;
}
.jr-select-media-btn {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.jr-select-media-btn:hover {
    background: #0062a3;
}
.jr-select-media-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.3);
}

.jr-challenge-opponent {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.jr-challenge-opponent h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #555;
}

.jr-media-preview {
    color: #666;
}

.jr-media-preview strong {
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.2);
}

.form-actions {
    margin-top: 25px;
    text-align: right;
}

.form-actions button {
    margin-left: 10px;
}

.button-cancel {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.button-cancel:hover {
    background: #e0e0e0;
}

/* My Media List Styles */
.jr-my-media-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.jr-my-media-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.jr-my-media-item:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.jr-my-media-item-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #212529;
}

.jr-my-media-item-info .media-type {
    font-size: 12px;
    color: #6c757d;
    text-transform: capitalize;
}

.jr-my-media-item-actions button {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.jr-button-positive {
    background: #28a745;
    color: white;
}

.jr-button-positive:hover {
    background: #218838;
}

.jr-button-negative {
    background: #dc3545;
    color: white;
}

.jr-button-negative:hover {
    background: #c82333;
}

.jr-button-positive:disabled,
.jr-button-negative:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Additional My Media styles */
.jr-my-media-item-info .media-owner {
    font-size: 13px;
    color: #495057;
    margin-right: 10px;
}

.jr-my-media-item-info .media-owner a {
    color: #007bff;
    text-decoration: none;
}

.jr-my-media-item-info .media-owner a:hover {
    text-decoration: underline;
}

.battle-ready-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #28a745;
    color: white;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.not-battle-ready {
    display: inline-block;
    padding: 4px 12px;
    background: #6c757d;
    color: white;
    border-radius: 4px;
    font-size: 13px;
}

/* Challenge Form Columns */
.jr-challenge-columns {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.jr-challenge-col {
    width: 48%;
}

.jr-user-media-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.jr-user-media-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.jr-user-media-item.jr-selected {
    border-color: #007cba;
    background: #e7f3ff;
}

.jr-user-media-thumb img {
    max-width: 60px;
    max-height: 60px;
    border-radius: 4px;
}

.jr-user-media-info {
    flex: 1;
}

.jr-opponent-media { flex: 0 0 45%; }
.jr-your-media { flex: 1 1 55%; }
.jr-user-media-item { position: relative; }
.jr-select-media-btn { margin-left: auto; }

@media (max-width: 700px) {
  .jr-challenge-columns { flex-direction: column; }
  .jr-opponent-media, .jr-your-media { flex: 1 1 100%; }
}

.jr-media-thumb img, .jr-user-media-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.jr-media-thumb {
    max-width: 180px;
    margin-bottom: 10px;
}

.jr-user-media-thumb {
    flex: 0 0 60px;
    max-width: 60px;
    overflow: hidden;
    border-radius: 4px;
}

.jr-user-media-info {
    display: flex;
    flex-direction: column;
}

.jr-user-media-item {
    cursor: pointer;
}

.jr-user-media-item:hover {
    background: #f1f8ff;
}

.jr-user-media-item.jr-selected {
    background: #dbefff;
    border-color: #005b9a;
}

.jr-challenge-form .button {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.jr-challenge-form .button:hover {
    background: #0062a3;
}

.jr-challenge-form .button-cancel {
    background: #f4f4f4;
    color: #333;
    border: 1px solid #ccc;
}

.jr-challenge-form .button-cancel:hover {
    background: #e0e0e0;
}

/* --------------------------------------------------
   Additional Challenge Form Styles (missing classes)
   --------------------------------------------------*/
.jr-media-title {
    margin: 0 0 6px;
    font-weight: 500;
    color: #333;
}

.jr-notice {
    padding: 10px;
    background: #fff4e5; /* light amber */
    border: 1px solid #ffe3b7;
    color: #664d03;
    border-radius: 4px;
    font-size: 14px;
} 