* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    color: #212529;
    min-height: 100vh;
    line-height: 1.6;
}

:root {
    --timestamp-primary: #4361ee;
    --timestamp-secondary: #3a0ca3;
    --timestamp-accent: #7209b7;
    --timestamp-light: #f8f9fa;
    --timestamp-dark: #212529;
    --timestamp-success: #4cc9f0;
    --timestamp-warning: #f72585;
    --timestamp-error: #e63946;
    --timestamp-border: #dee2e6;
    --timestamp-shadow: rgba(0, 0, 0, 0.05);
    --timestamp-tooltip-bg: #333333;
    --timestamp-tooltip-text: #ffffff;
    --timestamp-disabled: #6c757d;
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.12);
    --gradient-primary: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    --gradient-accent: linear-gradient(135deg, #7209b7 0%, #f72585 100%);
}

.timestamp-container {
    width: 100%;
    margin: 0;
    background: #ffffff;
    overflow: hidden;
}

.timestamp-header {
    background: linear-gradient(90deg, 
        rgba(67, 97, 238, 0.9) 0%, 
        rgba(58, 12, 163, 0.85) 50%, 
        rgba(114, 9, 183, 0.8) 100%),
        radial-gradient(circle at 30% 50%, rgba(76, 201, 240, 0.3) 0%, transparent 70%),
        radial-gradient(circle at 70% 20%, rgba(247, 37, 133, 0.2) 0%, transparent 60%);
    color: white;
    padding: 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.timestamp-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: timestamp-glow 8s linear infinite;
    pointer-events: none;
}

@keyframes timestamp-glow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.timestamp-h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.timestamp-subtitle {
    font-size: 0.9rem;
    opacity: 0.95;
    max-width: 100%;
    margin: 0 auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.timestamp-controls {
    padding: 10px;
    background: var(--timestamp-light);
    border-bottom: 1px solid var(--timestamp-border);
}

.timestamp-control-panel {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    align-items: start;
}

.timestamp-control-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.timestamp-control-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.timestamp-control-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.timestamp-card-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--timestamp-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.timestamp-card-title i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.4rem;
}

.timestamp-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--timestamp-dark);
    font-size: 0.9rem;
}

.timestamp-select, 
.timestamp-input, 
.timestamp-button {
    padding: 5px 6px;
    border: 1px solid var(--timestamp-border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
    height: 40px;
}

.timestamp-input {
    background: white;
    flex: 1;
    border: 1px solid var(--timestamp-primary);
    border-color: rgba(67, 97, 238, 0.2);
    transition: all 0.3s ease;
}

.timestamp-input:focus,
.timestamp-select:focus {
    outline: none;
    border-color: var(--timestamp-primary);
    border-width: 1px;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.timestamp-input.error {
    border-color: var(--timestamp-error);
    border-width: 1px;
}

.timestamp-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-width: 50px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.timestamp-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.timestamp-button:hover::after {
    width: 300px;
    height: 300px;
}

.timestamp-button:hover,
.timestamp-button:focus {
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.3);
    outline: none;
}

.timestamp-button:active {
    transform: translateY(0);
}

.timestamp-button:disabled {
    background: var(--timestamp-disabled);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
}

.timestamp-button-reset {
    background: var(--gradient-accent);
}

.timestamp-button-reset:hover,
.timestamp-button-reset:focus {
    box-shadow: 0 6px 20px rgba(114, 9, 183, 0.3);
}

.timestamp-output-section {
    padding: 10px;
}

.timestamp-section-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--timestamp-secondary);
    padding-bottom: 8px;
    font-weight: 600;
    border-bottom: 2px solid var(--gradient-primary);
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.timestamp-output-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.timestamp-output-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    min-height: 90px;
    transition: box-shadow 0.3s ease;
}

.timestamp-output-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.timestamp-output-label {
    font-weight: 600;
    color: var(--timestamp-secondary);
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timestamp-output-label i {
    width: 24px;
    height: 24px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.1rem;
}

.timestamp-output-value {
    font-size: 1.05rem;
    word-break: break-all;
    word-wrap: break-word;
    margin-bottom: 6px;
    color: var(--timestamp-dark);
    min-height: 32px;
    line-height: 1.5;
    padding-right: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.timestamp-copy-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 3px 3px 4px 10px;
    font-size: 0.7rem;
    position: absolute;
    right: 15px;
    top: 15px;
    transition: all 0.3s ease;
    height: 25px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 57px;
    z-index: 2;
    font-weight: 500;
}

.timestamp-copy-btn:hover,
.timestamp-copy-btn:focus {
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    outline: none;
}

.timestamp-copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.timestamp-conversion {
    margin-top: 10px;
}

.timestamp-conversion-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 15px;
}

.timestamp-conversion-row .timestamp-input {
    border-radius: 8px;
    margin-bottom: 0;
    border: 1px solid var(--timestamp-primary);
}

.timestamp-conversion-row .timestamp-select {
    width: 140px;
    margin: 0 5px 0 5px;
    background: white;
    border: 1px solid var(--timestamp-primary);
}

.timestamp-conversion-row .timestamp-select:focus {
    border-color: var(--timestamp-primary);
    border-width: 1px;
}

.timestamp-conversion-row .timestamp-output {
    flex: 1;
    border-radius: 8px;
    margin-bottom: 0;
    background-color: #fdf9ff;
    color: #8535c0;
    cursor: default;
    border: 1px solid var(--timestamp-primary);
    padding-right: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timestamp-unit-conversions {
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
}

.timestamp-unit-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.timestamp-unit-row:last-child {
    border-bottom: none;
}

.timestamp-unit-label {
    font-weight: 600;
    color: #495057;
}

.timestamp-unit-value {
    color: var(--timestamp-dark);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    word-break: break-all;
    text-align: right;
    max-width: 60%;
}

.timestamp-result {
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #e7f5ff 0%, #d0ebff 100%);
    border-radius: 12px;
    border-left: 4px solid var(--timestamp-success);
    font-size: 0.95rem;
    position: relative;
    min-height: 50px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.timestamp-result.error {
    background: linear-gradient(135deg, #ffeaea 0%, #ffd6d6 100%);
    border-left-color: var(--timestamp-error);
}

.timestamp-button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 15px;
    flex-wrap: nowrap;
}

.timestamp-button-group .timestamp-button {
    height: 40px;
    padding: 0 15px;
    min-width: 200px;
    flex: none;
}

.timestamp-convert-btn i {
    font-size: 0.95rem;
}

.timestamp-current-info {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.timestamp-current-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
}

.timestamp-current-time-large {
    font-size: 2.4rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
    letter-spacing: 1px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.timestamp-current-date {
    font-size: 1.5rem;
    color: var(--timestamp-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.timestamp-current-week {
    font-size: 1.3rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
}

.timestamp-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.timestamp-tooltip-text {
    visibility: hidden;
    width: 240px;
    background-color: var(--timestamp-tooltip-bg);
    color: var(--timestamp-tooltip-text);
    text-align: left;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.timestamp-tooltip:hover .timestamp-tooltip-text,
.timestamp-tooltip:focus .timestamp-tooltip-text {
    visibility: visible;
    opacity: 1;
}

.timestamp-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: timestamp-spin 1s linear infinite;
}

@keyframes timestamp-spin {
    to { transform: rotate(360deg); }
}

.timestamp-timezone-indicator {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.timestamp-info-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin: 20px 10px 10px;
    position: relative;
    overflow: hidden;
}

.timestamp-info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
}

.timestamp-info-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--timestamp-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.timestamp-info-title i {
    background: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.6rem;
}

.timestamp-info-content {
    line-height: 1.8;
    color: var(--timestamp-dark);
}

.timestamp-info-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.timestamp-info-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.timestamp-info-subtitle {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--timestamp-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timestamp-info-list {
    padding-left: 20px;
    margin-bottom: 12px;
}

.timestamp-info-list li {
    margin-bottom: 6px;
    position: relative;
}

.timestamp-info-list li::marker {
    color: var(--timestamp-accent);
}

.timestamp-info-tip {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px;
    border-radius: 12px;
    border-left: 4px solid var(--timestamp-success);
    margin-top: 12px;
    font-size: 0.95rem;
}

@media (max-width: 1024px) {
    .timestamp-button-group .timestamp-button {
        min-width: 200px;
    }
}

@media (max-width: 820px) {
    .timestamp-control-panel {
        grid-template-columns: 2fr 1fr;
        gap: 8px;
    }
    
    .timestamp-button-group .timestamp-button {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .timestamp-control-panel {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .timestamp-output-grid {
        grid-template-columns: 1fr;
    }
    
    .timestamp-h1 {
        font-size: 1.6rem;
    }
    
    .timestamp-current-time-large {
        font-size: 2rem;
    }
    
    .timestamp-current-date {
        font-size: 1.2rem;
    }
    
    .timestamp-button-group {
        flex-direction: row;
        gap: 8px;
    }
    
    .timestamp-button-group .timestamp-button {
        height: 40px;
        padding: 0 12px;
        min-width: 200px;
        flex: 1;
    }
    
    .timestamp-output-card {
        min-height: 90px;
    }
    
    .timestamp-output-value {
        padding-right: 10px;
    }
    
    .timestamp-info-card {
        margin: 15px 10px 10px;
        padding: 20px;
    }
}

@media (max-width: 450px) {
    .timestamp-control-panel {
        gap: 8px;
    }
    
    .timestamp-h1 {
        font-size: 1.4rem;
    }
    
    .timestamp-current-time-large {
        font-size: 1.8rem;
    }
    
    .timestamp-current-date {
        font-size: 1.1rem;
    }
    
    .timestamp-button-group {
        flex-direction: row;
        gap: 6px;
        justify-content: center;
    }
    
    .timestamp-button-group .timestamp-button {
        height: 40px;
        padding: 0 10px;
        min-width: auto;
        font-size: 0.85rem;
        flex: 1;
    }
    
    .timestamp-conversion-row {
        flex-direction: column;
        gap: 0;
    }
    
    .timestamp-conversion-row .timestamp-input {
        width: 100%;
        border-radius: 8px;
        margin-bottom: 6px;
        text-align: center;
        padding-left: 0;
        padding-right: 0;
    }
    
    .timestamp-conversion-row .timestamp-select {
        width: 100%;
        border-radius: 8px;
        margin-bottom: 6px;
        text-align: center;
        text-align-last: center;
        -moz-text-align-last: center;
        -webkit-text-align-last: center;
        padding-left: 0;
        padding-right: 0;
    }
    
    .timestamp-conversion-row .timestamp-output {
        width: 100%;
        border-radius: 8px;
        text-align: center;
        padding-left: 0;
        padding-right: 0;
    }
    
    .timestamp-output-value {
        padding-right: 10px;
    }
    
    .timestamp-copy-btn {
        min-width: 70px;
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    .timestamp-info-card {
        padding: 15px;
        margin: 10px 8px 8px;
    }
}