/**
 * Cookie Consent Banner Styles
 * クッキー同意バナーのスタイル
 */

#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #2c3e50;
    border-top: 1px solid #34495e;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    padding: 20px;
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

/* プライバシープリファレンスセンター（モーダル） */
#cookie-preference-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

#cookie-preference-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cookie-modal-content {
    background-color: #ffffff;
    border-radius: 4px;
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

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

.cookie-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.cookie-modal-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.cookie-modal-body {
    padding: 16px 20px;
}

.cookie-modal-description {
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 16px;
}

.cookie-modal-description a {
    color: #3498db;
    text-decoration: none;
}

.cookie-modal-description a:hover {
    text-decoration: underline;
}

.cookie-category {
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background-color: #fafafa;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.cookie-category-header:hover {
    background-color: #f0f0f0;
}

.cookie-category-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 !important;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-category-title::before {
    content: '▶';
    font-size: 10px;
    color: #666;
    transition: transform 0.2s ease;
    display: inline-block;
}

.cookie-category.expanded .cookie-category-title::before {
    transform: rotate(90deg);
}

.cookie-category-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* トグルスイッチ */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 22px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #27ae60;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:disabled + .toggle-slider {
    background-color: #27ae60;
    cursor: not-allowed;
    opacity: 0.6;
}

.toggle-always-active {
    font-size: 11px;
    color: #27ae60;
    font-weight: 600;
}

.cookie-category-body {
    padding: 10px 14px;
    background-color: #ffffff;
    border-top: 1px solid #e5e5e5;
    display: none;
}

.cookie-category.expanded .cookie-category-body {
    display: block;
}

.cookie-category-description {
    font-size: 12px;
    line-height: 1.4;
    color: #666;
    margin: 0 0 12px 0;
}

.cookie-list-title {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 12px 0 8px 0;
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-top: 8px;
}

.cookie-table thead {
    background-color: #f5f5f5;
}

.cookie-table th {
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.cookie-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #e5e5e5;
    color: #666;
    vertical-align: top;
}

.cookie-table tbody tr:last-child td {
    border-bottom: none;
}

.cookie-table tbody tr:hover {
    background-color: #fafafa;
}

.cookie-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
    background-color: #fafafa;
}

.cookie-modal-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cookie-modal-btn-decline {
    background-color: #7f8c8d;
    color: #ffffff;
}

.cookie-modal-btn-decline:hover {
    background-color: #95a5a6;
}

.cookie-modal-btn-save {
    background-color: #3498db;
    color: #ffffff;
}

.cookie-modal-btn-save:hover {
    background-color: #2980b9;
}

.cookie-modal-btn-accept {
    background-color: #27ae60;
    color: #ffffff;
}

.cookie-modal-btn-accept:hover {
    background-color: #229954;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.cookie-consent-text {
    flex: 1;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
    min-width: 300px;
}

.cookie-consent-text a {
    color: #5dade2;
    text-decoration: underline;
    margin-left: 5px;
}

.cookie-consent-text a:hover {
    color: #85c1e9;
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-consent-btn {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cookie-consent-accept {
    background-color: #27ae60;
    color: #ffffff;
}

.cookie-consent-accept:hover {
    background-color: #229954;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(39, 174, 96, 0.4);
}

.cookie-consent-decline {
    background-color: #7f8c8d;
    color: #ffffff;
}

.cookie-consent-decline:hover {
    background-color: #95a5a6;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(127, 140, 141, 0.4);
}

.cookie-consent-btn:active {
    transform: translateY(0);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    #cookie-consent-banner {
        padding: 15px;
    }

    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-consent-text {
        min-width: 100%;
        font-size: 13px;
        margin-bottom: 10px;
    }

    .cookie-consent-buttons {
        width: 100%;
        flex-direction: column;
    }

    .cookie-consent-btn {
        width: 100%;
        padding: 12px 24px;
    }

    .cookie-modal-content {
        max-height: 92vh;
        width: 95%;
    }

    .cookie-modal-header {
        padding: 16px;
    }

    .cookie-modal-body {
        padding: 16px;
    }

    .cookie-modal-footer {
        padding: 14px 16px;
        flex-direction: column;
    }

    .cookie-modal-btn {
        width: 100%;
        padding: 11px 16px;
    }

    .cookie-category-header {
        padding: 10px 12px;
    }

    .cookie-category-body {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .cookie-consent-text {
        font-size: 12px;
    }

    .cookie-consent-btn {
        font-size: 13px;
    }

    .cookie-modal-header h2 {
        font-size: 16px;
    }

    .cookie-modal-description {
        font-size: 12px;
    }

    .cookie-category-title {
        font-size: 13px;
    }

    .cookie-category-description {
        font-size: 11px;
    }

    .cookie-list-title {
        font-size: 11px;
    }

    .cookie-table {
        font-size: 10px;
    }

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