@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Courier Prime', monospace;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    overflow-x: auto;
}

.device-frame {
    position: relative;
    width: 640px;
    height: 480px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    border-radius: 15px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.device-body {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #95a5a6 0%, #7f8c8d 50%, #95a5a6 100%);
    padding: 20px;
}

.device-body::before {
    content: 'SONY';
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    color: #2c3e50;
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 2px;
}

.oled-screen {
    width: 480px;
    height: 320px;
    background: #000000;
    border-radius: 8px;
    margin: 0 auto 20px;
    position: relative;
    overflow: hidden;
    border: 2px solid #34495e;
    box-shadow: 
        inset 0 0 20px rgba(0, 100, 100, 0.1),
        0 0 20px rgba(0, 0, 0, 0.5);
}

.oled-screen.burn-in::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, transparent 40%, rgba(0, 139, 139, 0.05) 50%, transparent 60%),
        linear-gradient(0deg, transparent 80%, rgba(0, 139, 139, 0.03) 85%, transparent 90%);
    pointer-events: none;
}

.boot-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #000 0%, #001a1a 100%);
}

.boot-content {
    text-align: center;
    color: #008B8B;
}

.palm-logo {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #008B8B;
}

.boot-text {
    font-size: 14px;
    margin-bottom: 20px;
    color: #66cccc;
}

.boot-progress {
    width: 200px;
    height: 4px;
    background: #003333;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #008B8B, #00ffff);
    animation: loading 3s ease-in-out forwards;
}

@keyframes loading {
    to { width: 100%; }
}

.palm-app {
    width: 100%;
    height: 100%;
    background: #000;
    color: #ffffff;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    display: flex;
    flex-direction: column;
}

.palm-titlebar {
    background: linear-gradient(90deg, #008B8B 0%, #006666 100%);
    color: white;
    padding: 4px 8px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid #004444;
    flex-shrink: 0;
}

.launcher-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 16px;
    flex: 1;
}

.launcher-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 60px;
}

.launcher-item:hover, .launcher-item.selected {
    background: rgba(0, 139, 139, 0.2);
    border: 1px solid #008B8B;
}

.app-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.app-name {
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    color: #cccccc;
}

.app-desc {
    font-size: 8px;
    color: #888888;
    text-align: center;
}

.graffiti-area {
    background: #111;
    height: 40px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.graffiti-text {
    color: #666;
    font-size: 10px;
}

.media-list, .contact-list, .todo-list, .memo-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.media-item, .contact-item, .todo-item, .memo-item {
    display: flex;
    align-items: center;
    padding: 6px;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: background 0.2s;
}

.media-item:hover, .media-item.selected,
.contact-item:hover, .contact-item.selected,
.todo-item:hover, .todo-item.selected,
.memo-item:hover, .memo-item.selected {
    background: rgba(0, 139, 139, 0.2);
}

.media-thumbnail {
    width: 32px;
    height: 32px;
    background: #333;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 16px;
}

.photo-thumb { background: #4a4a2a; }
.music-thumb { background: #2a4a2a; }

.media-info {
    flex: 1;
}

.media-title, .contact-name, .todo-text, .memo-title {
    color: #ffffff;
    font-weight: bold;
    font-size: 11px;
}

.media-details, .contact-phone, .memo-date, .memo-preview {
    color: #999999;
    font-size: 9px;
}

.media-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 12px;
    background: #111;
    border-top: 1px solid #333;
}

.control-btn {
    width: 32px;
    height: 32px;
    background: #333;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #ccc;
}

.control-btn:hover {
    background: #008B8B;
    color: white;
}

.play-btn {
    background: #008B8B;
    color: white;
    font-size: 14px;
}

/* Movie App Specific Styles */
.movie-app {
    flex-direction: row;
}

.movie-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 60px;
    z-index: 10;
}

.tab-bar {
    display: flex;
    background: linear-gradient(90deg, #005555 0%, #008B8B 50%, #005555 100%);
}

.tab {
    flex: 1;
    padding: 4px 8px;
    text-align: center;
    font-size: 10px;
    cursor: pointer;
    border-right: 1px solid #003333;
}

.tab.active {
    background: rgba(255, 255, 255, 0.1);
}

.movie-content {
    flex: 1;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: #111;
    border-bottom: 1px solid #333;
    font-size: 9px;
    color: #ccc;
}

.movie-list {
    flex: 1;
    overflow-y: auto;
}

.movie-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-bottom: 1px solid #333;
    cursor: pointer;
}

.movie-item:hover, .movie-item.selected {
    background: rgba(0, 139, 139, 0.2);
}

.movie-thumbnail {
    width: 48px;
    height: 32px;
    background: #333;
    border-radius: 2px;
    margin-right: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.movie-info {
    flex: 1;
}

.movie-title {
    color: white;
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 2px;
}

.movie-details {
    color: #999;
    font-size: 8px;
    line-height: 1.2;
}

.movie-sidebar {
    width: 60px;
    background: linear-gradient(180deg, #003333 0%, #001a1a 100%);
    border-left: 1px solid #008B8B;
    display: flex;
    flex-direction: column;
    padding: 4px;
}

.sidebar-icons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding-top: 40px;
}

.sidebar-icon {
    width: 32px;
    height: 32px;
    background: rgba(0, 139, 139, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    color: #008B8B;
}

.sidebar-icon:hover {
    background: rgba(0, 139, 139, 0.4);
}

/* Calendar Styles */
.datebook-content {
    flex: 1;
    padding: 16px;
}

.calendar-header {
    text-align: center;
    color: #008B8B;
    font-weight: bold;
    margin-bottom: 16px;
    font-size: 14px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day-header {
    background: #333;
    color: #ccc;
    padding: 4px;
    text-align: center;
    font-size: 9px;
    font-weight: bold;
}

.calendar-day {
    background: #111;
    color: #ccc;
    padding: 8px 4px;
    text-align: center;
    font-size: 10px;
    cursor: pointer;
    min-height: 28px;
}

.calendar-day:hover {
    background: rgba(0, 139, 139, 0.2);
}

.calendar-day.today {
    background: #008B8B;
    color: white;
    font-weight: bold;
}

/* Todo Styles */
.todo-checkbox {
    margin-right: 8px;
    color: #008B8B;
    font-size: 14px;
}

.todo-priority {
    margin-left: auto;
    background: #333;
    color: #008B8B;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 8px;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #666;
}

/* Calculator Styles */
.calculator {
    background: #000;
}

.calc-display {
    background: #111;
    color: #00ff00;
    font-family: 'Courier Prime', monospace;
    font-size: 24px;
    padding: 16px;
    text-align: right;
    border-bottom: 1px solid #333;
    font-weight: bold;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    flex: 1;
    background: #333;
}

.calc-btn {
    background: #222;
    color: white;
    border: none;
    font-family: 'Courier Prime', monospace;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.calc-btn:hover {
    background: #444;
}

.calc-btn:active {
    background: #555;
}

.calc-btn.operator {
    background: #008B8B;
    color: white;
}

.calc-btn.operator:hover {
    background: #006666;
}

.calc-btn.equals {
    background: #ff6b35;
    grid-column: span 2;
}

.calc-btn.equals:hover {
    background: #e55a2b;
}

/* Device Controls */
.device-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, #bdc3c7 0%, #95a5a6 100%);
    border-top: 1px solid #7f8c8d;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
    padding: 0 20px;
}

.media-btn, .back-btn, .function-btn {
    width: 40px;
    height: 32px;
    background: linear-gradient(to bottom, #ecf0f1 0%, #bdc3c7 100%);
    border: 1px solid #95a5a6;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #2c3e50;
    transition: all 0.1s;
    box-shadow: 0 2px 0 #7f8c8d;
}

.media-btn:hover, .back-btn:hover, .function-btn:hover {
    background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
}

.media-btn:active, .back-btn:active, .function-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #7f8c8d;
}

.back-btn {
    width: 50px;
    font-size: 8px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.jog-dial {
    width: 48px;
    height: 48px;
    background: radial-gradient(circle, #ecf0f1 0%, #bdc3c7 70%, #95a5a6 100%);
    border: 2px solid #7f8c8d;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.1s;
    box-shadow: 
        0 4px 0 #7f8c8d,
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.jog-dial:hover {
    background: radial-gradient(circle, #f8f9fa 0%, #e9ecef 70%, #bdc3c7 100%);
}

.jog-dial:active {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 #7f8c8d,
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.jog-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #2c3e50;
    border-radius: 50%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Info Panel */
.info-panel {
    position: fixed;
    top: 20px;
    right: -300px;
    width: 280px;
    height: calc(100vh - 40px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 8px;
    transition: right 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 139, 139, 0.3);
}

.info-panel.show {
    right: 20px;
}

.info-toggle {
    position: absolute;
    left: -40px;
    top: 20px;
    width: 35px;
    height: 35px;
    background: rgba(0, 139, 139, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.info-toggle:hover {
    background: rgba(0, 139, 139, 1);
    transform: scale(1.1);
}

.info-content {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.info-content h3 {
    color: #008B8B;
    margin-top: 0;
    font-size: 18px;
}

.info-content h4 {
    color: #66cccc;
    margin-bottom: 8px;
    margin-top: 20px;
    font-size: 14px;
}

.info-content p {
    line-height: 1.4;
    color: #ccc;
    font-size: 14px;
}

.info-content ul {
    padding-left: 20px;
    color: #ccc;
}

.info-content li {
    margin-bottom: 4px;
    font-size: 12px;
}

.oled-settings label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: #ccc;
}

.oled-settings input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #008B8B;
}

.oled-settings select {
    background: #333;
    color: white;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 4px;
    font-size: 12px;
    margin-left: 8px;
}

.footer-link {
    margin-top: auto;
    padding-top: 20px;
    text-align: center;
    border-top: 1px solid #333;
}

.footer-link a {
    color: #008B8B;
    text-decoration: none;
    font-size: 12px;
}

.footer-link a:hover {
    color: #66cccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .device-frame {
        width: 90vw;
        height: 60vh;
        min-height: 400px;
    }
    
    .oled-screen {
        width: calc(90vw - 80px);
        height: calc(60vh - 140px);
        min-height: 200px;
    }
    
    .info-panel {
        width: calc(100vw - 40px);
        right: -100vw;
    }
    
    .info-panel.show {
        right: 20px;
    }
    
    .palm-app {
        font-size: 10px;
    }
    
    .launcher-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 12px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #333;
}

::-webkit-scrollbar-thumb {
    background: #008B8B;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #006666;
}