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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.app-header {
    background: white;
    padding: 2rem 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.app-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.app-header p {
    color: #718096;
    font-size: 0.9rem;
}

.main-content {
    padding: 1.5rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 3rem 1.5rem;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-area h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.upload-area p {
    color: #718096;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

#imageInput {
    display: none;
}

.upload-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.upload-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Preview Section */
.preview-section {
    margin-bottom: 2rem;
}

.image-preview {
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.analyze-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.analyze-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

/* Rate Input Section */
.rate-input-section {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.rate-input-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.rate-form .form-group {
    margin-bottom: 1.5rem;
}

.rate-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.input-group span {
    color: #718096;
    font-size: 0.9rem;
    min-width: 40px;
}

/* Time Input Section */
.time-input-section {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.time-input-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.time-input-methods {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #e2e8f0;
    padding: 0.25rem;
    border-radius: 8px;
}

.method-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.method-btn.active {
    background: white;
    color: #667eea;
    font-weight: 500;
}

.time-inputs {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.time-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.time-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-size: 0.9rem;
}

.time-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.time-group span {
    color: #718096;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.time-range {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calculate-btn {
    width: 100%;
    background: #ed8936;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

.calculate-btn:hover {
    background: #dd6b20;
    transform: translateY(-1px);
}

/* Result Section */
.result-section {
    margin-bottom: 2rem;
}

.result-card {
    background: white;
    border: 2px solid #48bb78;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
}

.result-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.result-details {
    margin-bottom: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
}

.result-item .label {
    font-weight: 500;
    color: #4a5568;
}

.result-item .value {
    font-weight: 600;
    color: #2d3748;
}

.result-item .value.price {
    color: #48bb78;
    font-size: 1.25rem;
}

.calculation-breakdown {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
    font-size: 0.9rem;
    color: #2f855a;
}

.reset-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.reset-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Loading animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .time-inputs {
        flex-direction: column;
        gap: 1rem;
    }
}