* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.status-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.status-card.reading {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    animation: pulse 2s infinite;
}

.status-card.success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.status-card.error {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.status-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.status-text {
    font-size: 1.2em;
    font-weight: 600;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    flex: 1;
    padding: 18px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-secondary {
    background: white;
    color: #667eea;
}

.btn-secondary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-icon {
    font-size: 1.2em;
}

.info-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-box h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.info-box li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.results {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.results h2 {
    margin-bottom: 15px;
    color: #667eea;
}

.tag-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tag-item {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.tag-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tag-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tag-item-time {
    font-size: 0.85em;
    color: #666;
}

.tag-item-data {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 10px;
    border-radius: 5px;
    word-break: break-all;
    font-size: 0.9em;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

/* Write Section */
.write-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.write-section h2 {
    margin-bottom: 5px;
    color: #667eea;
}

.section-subtitle {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.write-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.form-input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
    background: white;
    color: #333;
    width: 100%;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: #999;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fafafa;
}

.btn-write {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    margin-top: 5px;
    border: none;
}

.btn-write:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.3);
}

.btn-write:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-write:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Navigation */
.navigation {
    margin: 20px 0;
    text-align: center;
}

.nav-link {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.nav-link:active {
    transform: scale(0.98);
}

/* Instructions Box */
.instructions-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.instructions-box h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.instructions-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 20px;
}

.instructions-list li {
    padding: 12px 0;
    padding-left: 35px;
    position: relative;
    line-height: 1.6;
}

.instructions-list li:before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 12px;
    background: #667eea;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.instructions-list {
    counter-reset: step-counter;
}

.instruction-status {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 15px;
}

.instruction-status p {
    margin: 10px 0 0 0;
    font-weight: 600;
    color: #333;
}

.pulse-animation {
    font-size: 3em;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Form Help Text */
.form-help {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

