@charset "UTF-8";

/* ==========================================================================
   Secure Tool Common Styles (Ver.Final 2.1)
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Global Reset & Adjustment
   -------------------------------------------------------------------------- */
body {
    padding-top: 0 !important;
}

.p-secure-tool {
    font-family: var(--font-body, "Helvetica Neue", Arial, sans-serif);
    color: var(--text-main, #333);
    line-height: 1.6;
    padding-top: 60px; /* Header height */
}

/* --------------------------------------------------------------------------
   1. Layout
   -------------------------------------------------------------------------- */
.p-secure-tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 120px;
}

/* --------------------------------------------------------------------------
   2. Header (Fixed)
   -------------------------------------------------------------------------- */
.p-secure-tool-header {
    background-color: #2c3e50;
    color: white;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    height: 60px;
    box-sizing: border-box;
}

.p-secure-tool-title-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.p-secure-tool-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.p-secure-tool-badge {
    background-color: #27ae60;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    font-family: var(--font-code, monospace);
    letter-spacing: 0.05em;
}

.p-secure-tool-scrolltop {
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.8rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: bold;
}
.p-secure-tool-scrolltop:hover {
    color: white;
    border-color: white;
    background-color: rgba(255,255,255,0.1);
}

/* --------------------------------------------------------------------------
   3. Hero Section
   -------------------------------------------------------------------------- */
.p-secure-tool-hero {
    text-align: center;
    padding: 30px 20px 20px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.p-secure-tool-hero h1 {
    font-size: 1.5rem;
    margin: 0 0 10px;
    color: var(--text-main, #333);
    line-height: 1.4;
    text-align: center;
}

/* ★修正: pタグに直接 center を指定して global CSS を上書き */
.p-secure-tool-hero p {
    font-size: 0.95rem;
    color: var(--text-sub, #555);
    margin: 0;
    text-align: center;
}

/* --------------------------------------------------------------------------
   4. Drop Zone
   -------------------------------------------------------------------------- */
.p-secure-tool-dropzone {
    border: 3px dashed #bdc3c7;
    border-radius: 10px;
    padding: 50px 20px;
    text-align: center;
    background-color: white;
    transition: all 0.3s;
    cursor: pointer;
    margin-bottom: 20px;
    position: relative;
}

.p-secure-tool-dropzone:hover,
.p-secure-tool-dropzone.dragover {
    background-color: #e8f6f3;
    border-color: #1abc9c;
    transform: scale(1.01);
}

/* ★修正: pタグに直接 center を指定 */
.p-secure-tool-dropzone p {
    font-size: 1.1rem;
    font-weight: bold;
    color: #7f8c8d;
    margin: 0 0 10px;
    text-align: center;
}

.p-secure-tool-dropzone .sub-text {
    font-size: 0.85rem;
    font-weight: normal;
    color: #95a5a6;
    display: block; /* 念のためブロック要素化 */
    text-align: center;
}

/* --------------------------------------------------------------------------
   5. Toolbar & Settings
   -------------------------------------------------------------------------- */
.p-secure-tool-toolbar {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.p-secure-tool-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}
.p-secure-tool-row:last-child { margin-bottom: 0; }

.p-secure-tool-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.p-secure-tool-divider {
    height: 30px;
    width: 1px;
    background-color: #ddd;
    margin: 0 5px;
}

/* Buttons */
.btn-tool {
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.btn-tool-outline { background-color: white; border-color: #bdc3c7; color: #555; }
.btn-tool-outline:hover { background-color: #f8f9fa; border-color: #95a5a6; color: #333; }
.btn-tool-warn { background-color: white; border-color: #e74c3c; color: #e74c3c; }
.btn-tool-warn:hover { background-color: #fdedec; }
.btn-tool-calc { background-color: #8e44ad; color: white; }
.btn-tool-calc:hover { background-color: #71368a; }
.btn-tool-primary { background-color: var(--accent-blue, #3498db); color: white; }
.btn-tool-primary:hover { opacity: 0.9; }

/* Settings Panel */
.p-secure-tool-settings {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}
.settings-header { font-weight: bold; font-size: 0.95rem; color: #2c3e50; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.settings-content { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.setting-item { display: flex; flex-direction: column; gap: 5px; }
.setting-label { font-size: 0.8rem; color: #666; font-weight: bold; }

.p-secure-tool input[type="number"], .p-secure-tool input[type="text"], .p-secure-tool select {
    padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   6. Sticky Footer (Smart Save Button)
   -------------------------------------------------------------------------- */
.p-secure-tool-footer {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: white; border-top: 1px solid #ddd;
    padding: 15px 20px; box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    display: flex; justify-content: center; gap: 20px; z-index: 500;
}

.smart-btn-group { display: flex; position: relative; }
.smart-btn-main {
    border-top-right-radius: 0; border-bottom-right-radius: 0;
    border-right: 1px solid rgba(255,255,255,0.2);
    padding: 12px 30px; font-size: 1.1rem;
}
.smart-btn-arrow {
    border-top-left-radius: 0; border-bottom-left-radius: 0;
    padding: 0 12px; font-size: 0.9rem;
}

.smart-menu {
    display: none; position: absolute; bottom: 100%; right: 0;
    background: white; border: 1px solid #ddd; border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); min-width: 280px;
    margin-bottom: 8px; flex-direction: column; overflow: hidden; z-index: 501;
}
.smart-menu.show { display: flex; }
.smart-menu-item {
    padding: 12px 15px; text-align: left; background: none; border: none;
    border-bottom: 1px solid #eee; color: #333; font-weight: bold;
    cursor: pointer; width: 100%; transition: background 0.2s;
}
.smart-menu-item:last-child { border-bottom: none; }
.smart-menu-item:hover { background-color: #f0f8ff; color: var(--accent-blue, #3498db); }
.smart-menu-note { display: block; font-weight: normal; font-size: 0.75rem; color: #7f8c8d; margin-top: 3px; }

/* --------------------------------------------------------------------------
   7. Loading & Modal
   -------------------------------------------------------------------------- */
.p-secure-tool-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.95); z-index: 9999; display: none;
    flex-direction: column; justify-content: center; align-items: center;
}
.p-secure-tool-spinner {
    width: 50px; height: 50px; border: 5px solid #f3f3f3;
    border-top: 5px solid var(--accent-blue, #3498db);
    border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.p-secure-tool-progress { width: 300px; text-align: center; }
.progress-bar-bg { width: 100%; height: 10px; background: #eee; border-radius: 5px; overflow: hidden; margin-bottom: 8px; }
.progress-bar-fill { height: 100%; background: var(--accent-blue, #3498db); width: 0%; transition: width 0.2s; }
.progress-text { font-size: 0.9rem; font-weight: bold; color: #555; }

.p-secure-tool-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 2000; display: none;
    flex-direction: column; justify-content: flex-start; align-items: center;
    overflow-y: auto; padding: 60px 0;
}
.p-secure-tool-modal img { max-width: 90%; height: auto; box-shadow: 0 0 20px rgba(0,0,0,0.5); background: white; }
.p-secure-tool-modal-close {
    color: white; font-size: 2.5rem; position: fixed; top: 20px; right: 30px;
    cursor: pointer; z-index: 2001; line-height: 1;
}
.p-secure-tool-modal-close:hover { color: #e74c3c; }

/* --------------------------------------------------------------------------
   8. Utilities
   -------------------------------------------------------------------------- */
.u-hidden { display: none !important; }
.u-text-center { text-align: center; }
.u-mt-20 { margin-top: 20px; }

/* Tooltip (Simple) */
.tooltip-wrap { position: relative; display: inline-block; margin-left: 5px; }
.tooltip-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; background: #95a5a6; color: white;
    border-radius: 50%; font-size: 10px; font-weight: bold; cursor: help;
}
.tooltip-icon:hover { background: var(--accent-blue, #3498db); }
.tooltip-body {
    visibility: hidden; opacity: 0; width: 250px; background-color: #2c3e50;
    color: #fff; text-align: left; border-radius: 6px; padding: 10px;
    position: absolute; z-index: 100; bottom: 130%; left: 50%;
    transform: translateX(-50%); font-size: 0.8rem; line-height: 1.4;
    transition: opacity 0.2s; pointer-events: none; font-weight: normal;
}
.tooltip-body::after {
    content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px;
    border-width: 5px; border-style: solid; border-color: #2c3e50 transparent transparent transparent;
}
.tooltip-icon:hover .tooltip-body { visibility: visible; opacity: 1; }

/* Mobile Response */
@media (max-width: 768px) {
    .p-secure-tool-container { padding: 0 15px 120px; }
    .p-secure-tool-header { padding: 0.8rem 1rem; }
    .p-secure-tool-title { font-size: 1.1rem; }
    .p-secure-tool-row, .settings-content { flex-direction: column; align-items: flex-start; }
    .p-secure-tool-footer { flex-direction: column; padding: 10px; }
    .smart-btn-group { width: 100%; }
    .smart-btn-main { width: 100%; text-align: center; padding: 12px; }
    .smart-menu { bottom: 50px; width: 100%; }
}
