/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Utility Classes */
.sp-only {
    display: none;
}

.tablet-only {
    display: none;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Main Layout */
.main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.header__title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.header__title-keyword {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
}

.header__title-brand {
    display: inline-block;
    font-size: 3rem;
}


.header__subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Settings Section */
.settings {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    width: 100%;
}

.settings__two-column {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
}

.settings__column {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.settings__column .settings__actions {
    margin-top: 0.5rem;
}

.settings__actions--mobile {
    display: none !important;
    margin-top: 1.5rem;
}

.settings__actions--desktop {
    display: block !important;
}

.settings__group {
    margin-bottom: 0;
}

.settings__fieldset {
    border: none;
}

.settings__legend {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: #333;
}

.settings__radio-group {
    display: flex;
    gap: 1.5rem;
}

.settings__radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
}

.settings__radio {
    margin-right: 0.5rem;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: #667eea;
}

.settings__checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.settings__checkbox {
    margin-right: 0.5rem;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: #667eea;
}

.settings__label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #333;
}

.settings__input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.settings__input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Symbol Selection */
.symbol-selection {
    width: 100%;
}

.symbol-selection__controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: flex-start;
}

.symbol-selection__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 0.375rem;
    max-width: 100%;
}

.symbol-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.symbol-checkbox__input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.symbol-checkbox__label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background: #f8f9fa;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.symbol-checkbox__input:checked + .symbol-checkbox__label {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.symbol-checkbox__input:hover + .symbol-checkbox__label {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.symbol-checkbox__input:focus + .symbol-checkbox__label {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Symbol Settings */
.symbol-settings__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.symbol-settings__controls {
    display: none;
    gap: 0.5rem;
}

.symbol-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 2px solid #667eea;
    background: #f8f9fa;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: none;
}

.symbol-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

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

.symbol-selection {
    display: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn--primary {
    background: #5829ce;
    color: white;
}

.btn--primary:hover {
    background: #1e1b4b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 46, 129, 0.5);
}

.btn--secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

.btn--secondary:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
}

.btn__icon {
    display: flex;
    align-items: center;
}

.btn__icon-img {
    width: 1.2rem;
    height: 1.2rem;
}

/* Passwords Section */
.passwords {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    width: 100%;
}

.passwords__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #333;
}

.passwords__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
    justify-items: stretch;
}

/* Password Items */
.password-item {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: auto;
    min-height: 80px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.password-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.password-item--copied {
    border-color: #28a745;
    background: #f8fff9;
}

.password-item__text {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    word-break: keep-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    letter-spacing: 0.01em;
    flex: 1;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 1.2em;
}

.password-item__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0.7;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.password-item__copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.password-item__copy-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.password-item__copy-icon {
    width: 1rem;
    height: 1rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #28a745;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast--show {
    transform: translateX(0);
    opacity: 1;
}

.toast__text {
    font-weight: 600;
}

/* Empty State */
.passwords__empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.passwords__empty-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.passwords__empty-hint {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sp-only {
        display: inline;
    }
    
    .main {
        padding: 1rem;
    }
    
    .header__title {
        font-size: 2.5rem;
    }
    
    .header__subtitle {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .header__title-keyword {
        font-size: 1.1rem;
        opacity: 0.95;
    }
    
    .settings {
        padding: 1.5rem;
    }
    
    .settings__two-column {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .settings__actions--desktop {
        display: none !important;
    }
    
    .settings__actions--mobile {
        display: block !important;
    }
    
    .settings__actions--mobile .btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .symbol-selection__grid {
        grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
        gap: 0.25rem;
    }
    
    .symbol-checkbox__label {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .symbol-settings__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .symbol-settings__controls {
        align-self: flex-end;
    }
    
    .footer__text {
        line-height: 1.8;
    }
    
    .footer__text::after {
        content: "\A";
        white-space: pre;
        position: absolute;
        left: 0;
        width: 0;
        height: 0;
        overflow: hidden;
    }
    
    .footer__text {
        position: relative;
    }
    
    .footer__link::before {
        content: "\A";
        white-space: pre;
    }
    
    .passwords {
        padding: 1.5rem;
    }
    
    .passwords__grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .password-item {
        padding: 1.25rem;
    }
    
    .password-item__text {
        font-size: 1.1rem;
        letter-spacing: 0;
    }
    
    .settings__radio-group {
        flex-direction: row;
        gap: 1rem;
    }
    
    .settings__actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
    
    .toast {
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .tablet-only {
        display: inline;
    }
    
    .passwords__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .password-item__text {
        font-size: 1rem;
    }
}

@media (min-width: 1025px) {
    .passwords__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
    
    .password-item__text {
        font-size: 1rem;
    }
}

/* Focus Management */
.password-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.footer__text {
    color: white;
    font-size: 0.875rem;
    opacity: 0.8;
}

.footer__link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer__link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.password-item {
    animation: fadeIn 0.3s ease-out;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .toast {
        display: none;
    }
    
    .settings__actions {
        display: none;
    }
    
    .footer {
        display: none;
    }
}