:root {
    /* Primary Color - 本屋大賞らしいオレンジ */
    --primary-color: #e67e22;
    --primary-light: #f39c12;
    --primary-dark: #d35400;
    
    /* Secondary Color - 深いブラウン（本・書店のイメージ） */
    --secondary-color: #8b4513;
    --secondary-light: #a0522d;
    --secondary-dark: #6b3410;
    
    /* Tertiary Color - 温かみのあるベージュ */
    --tertiary-color: #d2b48c;
    --tertiary-light: #deb887;
    --tertiary-dark: #cd853f;
    
    /* Neutral Colors */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #6c757d;
    --dark-gray: #495057;
    --black: #212529;
    
    /* Status Colors */
    --unread-color: #e74c3c;
    --reading-color: #f39c12;
    --completed-color: #27ae60;
    
    /* Background */
    --bg-gradient: linear-gradient(135deg, #f39c12 0%, #e67e22 50%, #d35400 100%);
    --bg-pattern: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
                 radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
                 radial-gradient(circle at 40% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
    --card-bg: #ffffff;
    --hover-bg: #f8f9fa;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient), var(--bg-pattern);
    background-size: 100% 100%, 200px 200px;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 30px;
    text-align: center;
    border-bottom: 3px solid var(--secondary-color);
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: white;
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
    margin: 0;
}

.manual-update-bubble {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    margin-left: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Controls */
.controls {
    background: var(--light-gray);
    border-bottom: 1px solid var(--gray);
}

.data-controls-top {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(108, 117, 125, 0.2);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-section {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.info-text {
    font-size: 0.9em;
    color: var(--gray);
}

.info-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-text a:hover {
    text-decoration: underline;
}

.data-controls-section {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-danger {
    background: var(--unread-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.share-progress-btn {
    background: #000000;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.share-progress-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: #333333;
}

.x-icon {
    font-weight: bold;
    font-size: 1.1em;
}

.warning-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.9em;
    color: #856404;
}

.warning-notice a {
    color: var(--primary-color);
    text-decoration: none;
}

.warning-notice a:hover {
    text-decoration: underline;
}

/* Browser Storage Information Section */
.browser-storage-info {
    background: linear-gradient(135deg, #fef5e7, #fdf2e9);
    border: 1px solid var(--primary-light);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 12px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.info-header {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.browser-info-grid {
    display: grid;
    gap: 8px;
    font-size: 0.9em;
}

.browser-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    color: var(--dark-gray);
}

.browser-item.safari {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
}

.backup-recommendation {
    padding: 10px 12px;
    background: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #28a745;
    border-radius: 4px;
    color: var(--dark-gray);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .browser-storage-info {
        padding: 12px 16px;
    }
    
    .info-header {
        font-size: 1em;
    }
    
    .browser-info-grid {
        font-size: 0.85em;
    }
}

/* Filters */
.filters-section {
    padding: 15px 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    align-items: end;
}

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

.filter-item label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.filter-item select,
.filter-item input {
    padding: 8px 12px;
    border: 1px solid var(--gray);
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-item select:focus,
.filter-item input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* Stats */
.stats {
    padding: 20px;
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
    border-bottom: 1px solid var(--gray);
}

.stats-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

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

.filter-label {
    font-size: 0.85em;
    color: var(--dark-gray);
    font-weight: 600;
}

.filter-buttons {
    display: flex;
    background: var(--light-gray);
    border-radius: 20px;
    padding: 2px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.filter-btn {
    flex: 1;
    padding: 6px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.85em;
    border-radius: 18px;
    transition: all 0.3s ease;
    color: var(--gray);
    font-weight: 500;
    white-space: nowrap;
}

.filter-btn:hover {
    background: rgba(255,255,255,0.5);
}

.filter-btn.active {
    color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.filter-note {
    font-size: 0.8em;
    color: var(--gray);
    margin-left: 15px;
}

.stats-info {
    margin-bottom: 20px;
    text-align: center;
}

.stats-condition {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: var(--dark-gray);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-block;
    border: 1px solid #dee2e6;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--gray);
    transition: transform 0.3s ease;
}

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

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--gray);
    margin-top: 5px;
}

.pie-chart-card {
    position: relative;
}

.pie-chart-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.pie-chart-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pie-chart {
    width: 80px;
    height: 80px;
}

.pie-chart-text .stat-number {
    font-size: 1.2em;
}

.pie-progress {
    transition: stroke-dasharray 0.3s ease;
}

/* Book List */
.book-list {
    padding: 20px;
}

.round-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.2);
}

.book-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.book-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.book-item.honya {
    border-left-color: var(--primary-color);
}

.book-item.read {
    background: linear-gradient(135deg, #d5f4e6, #ffffff);
    border-left-color: var(--completed-color);
}

.book-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.book-info {
    flex: 1;
}

.book-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.book-author {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.book-meta {
    color: #95a5a6;
    font-size: 0.9em;
}

.award-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    margin-right: 10px;
}

.award-badge.honya {
    background: var(--primary-color);
}

.winner-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 700;
    margin-left: 10px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b4513;
    border: 2px solid #ffd700;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.candidate-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 8px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border: 1px solid #42a5f5;
    box-shadow: 0 1px 3px rgba(33, 150, 243, 0.2);
}

.winner-card {
    background: linear-gradient(135deg, #fff5e6, #ffffff);
}

.candidate-card {
    background: linear-gradient(135deg, #f5f5f5, #ffffff);
}

.book-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.reading-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 20px;
}

.status-buttons {
    display: flex;
    background: var(--light-gray);
    border-radius: 20px;
    padding: 2px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--gray);
}

.status-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    border-radius: 18px;
    transition: all 0.3s ease;
    color: var(--gray);
    font-weight: 500;
    white-space: nowrap;
}

.status-btn:hover {
    background: rgba(255,255,255,0.5);
}

.status-btn.active {
    color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.status-btn.unread.active {
    background: linear-gradient(135deg, var(--unread-color), #c0392b);
}

.status-btn.reading.active {
    background: linear-gradient(135deg, var(--reading-color), #e67e22);
}

.status-btn.completed.active {
    background: linear-gradient(135deg, var(--completed-color), #229954);
}

.kindle-link {
    background: linear-gradient(135deg, var(--tertiary-color), var(--tertiary-light));
    color: var(--white);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: 1px solid var(--tertiary-dark);
}

.kindle-link:hover {
    background: linear-gradient(135deg, var(--tertiary-dark), var(--tertiary-color));
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.share-book-btn {
    background: #1d1d1d;
    color: white;
    border: 1px solid #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-book-btn:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.memo-section {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.memo-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
    resize: vertical;
}

.memo-textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: var(--gray);
}

.loading-card {
    opacity: 0.6;
    pointer-events: none;
}

.loading-placeholder {
    position: relative;
    overflow: hidden;
    background: var(--light-gray);
    border-radius: 4px;
    height: 20px;
    margin-bottom: 8px;
}

.loading-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Small buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-danger {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
}

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

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .book-header {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .book-actions {
        align-items: flex-start;
    }
    
    .data-controls-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .book-item {
        padding: 15px;
    }
    
    .book-title {
        font-size: 1.1rem;
    }
}

/* Share buttons styles */
.share-buttons-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.share-progress-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: white;
    font-weight: bold;
    min-width: 140px;
    justify-content: center;
}

.share-progress-btn.twitter {
    background: #000000;
}
.share-progress-btn.twitter:hover {
    background: #333333;
}


.share-progress-btn.bluesky {
    background: #0085ff;
}
.share-progress-btn.bluesky:hover {
    background: #006acc;
}

.share-progress-btn.download {
    background: #28a745;
}
.share-progress-btn.download:hover {
    background: #1e7e34;
}

.share-progress-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Book share dropdown styles */
.share-book-dropdown {
    position: relative;
    display: inline-block;
}

.share-book-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.share-book-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.share-book-options {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 150px;
    display: none;
    overflow: hidden;
}

.share-book-dropdown.open .share-book-options {
    display: block;
}

.share-book-options button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: white;
    color: #333;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.share-book-options button:last-child {
    border-bottom: none;
}

.share-book-options button:hover {
    background: #f8f9fa;
}

@media (max-width: 600px) {
    .share-buttons-group {
        flex-direction: column;
        width: 100%;
    }
    
    .share-progress-btn {
        width: 100%;
    }
    
    .share-book-options {
        right: auto;
        left: 0;
    }
}