/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: #000;
    color: #fff;
    height: 100vh;
    overflow: hidden;
    cursor: url('https://mac-cursors.netlify.app/png/default.png') 4 2, default;
}

/* Boot Screen */
.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeOut 1s ease-in-out 3s forwards;
}

.boot-logo {
    text-align: center;
}

.apple-logo {
    width: 100px;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"/></svg>') no-repeat center;
    margin: 0 auto 20px;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background-color: #333;
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background-color: #fff;
    animation: loading 2s ease-in-out forwards;
}

/* Desktop Environment */
.desktop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #151515 url('https://wallpapercave.com/wp/wp6843223.jpg') no-repeat center center;
    background-size: cover;
    display: none;
    animation: fadeIn 1s ease-in-out forwards;
}

/* Menu Bar */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 25px;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 12px;
    z-index: 100;
}

.apple-menu {
    margin-right: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 25px;
}

.apple-menu svg {
    height: 18px;
    width: 18px;
    display: block;
}

.menu-items span {
    margin-right: 15px;
    cursor: pointer;
}

.menu-items span:hover {
    color: #007AFF;
}

.menu-right {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

/* Desktop Icons */
.desktop-icons {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 20px;
    margin-top: 25px;
}

.icon {
    width: 80px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon:hover {
    transform: scale(1.1);
}

.icon-image {
    font-size: 40px;
    margin-bottom: 5px;
}

.icon-image img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.icon-text {
    font-size: 12px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Dock */
.dock {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 5px 10px;
    display: flex;
    gap: 5px;
    z-index: 100;
}

.dock-item {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    transition: transform 0.2s;
}

.dock-item img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.dock-item:hover {
    transform: scale(1.2);
}

.dock-divider {
    width: 1px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 5px;
}

/* Windows */
.window {
    position: absolute;
    top: 50%; /* Keep top/left 50% for initial position */
    left: 50%;
    width: 600px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: none;
    margin: 0;
    padding: 0;
}

.window-header {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
}

.window-controls {
    display: flex;
    gap: 8px;
    margin-right: 10px;
    align-items: center;
    height: 20px;
}

.window-controls span {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #222;
    background-clip: padding-box;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.08);
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.close { background-color: #FF5F56; }
.minimize { background-color: #FFBD2E; }
.maximize { background-color: #27C93F; }

.window-controls span:hover {
    filter: brightness(0.95);
}

.window-title {
    flex-grow: 1;
    text-align: center;
    font-size: 14px;
}

.window-content {
    padding: 20px;
    color: #fff;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.skill-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

/* Contact Info */
.contact-info {
    margin-top: 20px;
}

.contact-info p {
    margin-bottom: 10px;
}

.safari-bar {
    background: #f5f5f7;
    color: #222;
    padding: 6px 16px;
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0;
}
.safari-url {
    background: #fff;
    border-radius: 5px;
    padding: 2px 10px;
    font-size: 13px;
    color: #555;
    border: 1px solid #e0e0e0;
}
.safari-frame {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 0 0 8px 8px;
    background: #fff;
    margin: 0;
    display: block;
}

/* Animations */
@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Show desktop after boot animation */
.boot-screen.fade-out + .desktop {
    display: block;
}

/* iPhone Player Styles */
.iphone-frame {
    width: 350px; /* Further adjusted width for a smaller iPhone */
    height: 760px; /* Further adjusted height for a smaller iPhone */
    background-color: #222; /* Darker bezel color */
    border-radius: 50px; /* More pronounced rounded corners */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    margin: 20px auto; /* Center the iPhone in its window */
    border: 5px solid #000; /* Inner black border for realism */
    box-sizing: content-box; /* Ensure border is outside dimensions */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; /* Remove internal padding */
}

.iphone-screen {
    width: 100%; /* Fill the frame */
    height: 100%; /* Fill the frame */
    background-color: #000; /* Screen background */
    border-radius: 45px; /* Slightly less rounded than frame */
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: url('https://www.ytechb.com/wp-content/uploads/2023/09/iPhone-15-Pro-Blue-Wallpaper-5.webp') no-repeat center center; /* iPhone 16 Pro wallpaper */
    background-size: cover;
    color: white; /* Default text color for screen content */
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px 0px 20px; /* Adjust padding for status bar */
    font-size: 14px;
    font-weight: 600;
    z-index: 10; /* Ensure it's above other content */
    position: relative; /* Needed for positioning relative to screen */
    background-color: rgba(0, 0, 0, 0.25); /* Darker translucent background for better contrast */
    backdrop-filter: blur(10px); /* Apply blur for frosted glass effect */
    color: white; /* Ensure all text in status bar is white */
}

.status-icons img {
    height: 14px;
    margin-left: 5px;
}

.dynamic-island {
    position: absolute;
    top: 10px; /* Position from top of screen */
    left: 50%;
    transform: translateX(-50%);
    width: 120px; /* Width of Dynamic Island */
    height: 30px; /* Height of Dynamic Island */
    background-color: #000; /* Black for the island */
    border-radius: 20px;
    z-index: 15; /* Ensure it's above status bar */
}

.iphone-widgets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Two columns for widgets */
    gap: 15px; /* Spacing between widgets */
    padding: 60px 20px 15px 20px; /* Adjusted padding to account for status bar/island */
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    max-height: 400px; /* Limit height to prevent overflow into apps */
    overflow-y: hidden; /* Allow scrolling if too many widgets */
    overflow-x: hidden; /* Hide horizontal scrollbar */
    -webkit-overflow-scrolling: touch;
    margin-top: 20px; /* Space between dynamic island and widgets */
}

.iphone-widget {
    background-color: rgba(255, 255, 255, 0.15); /* Semi-transparent background */
    border-radius: 18px; /* Rounded corners for widgets */
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    color: white;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.calendar-widget {
    grid-column: span 1; /* Half width */
    height: 180px;
}

.calendar-widget .widget-header {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.calendar-widget .widget-day {
    color: #f00; /* Red for Wednesday */
    font-weight: bold;
}

.calendar-widget .widget-date {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
}

.calendar-widget .widget-event-list {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.calendar-widget .widget-event {
    display: flex;
    align-items: center;
    font-size: 12px;
    gap: 5px;
}

.calendar-widget .event-color-bar {
    width: 3px;
    height: 12px;
    border-radius: 2px;
}

.calendar-widget .event-color-bar.green { background-color: #32CD32; }
.calendar-widget .event-color-bar.yellow { background-color: #FFD700; }

.calendar-widget .event-title { font-weight: bold; }
.calendar-widget .event-time { color: rgba(255, 255, 255, 0.7); }

.weather-widget {
    grid-column: span 1; /* Half width */
    height: 180px;
    background: rgba(255, 255, 255, 0.2); /* Slightly different transparency */
}

.weather-widget .weather-location {
    font-size: 14px;
    margin-bottom: 5px;
}

.weather-widget .weather-temp {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
}

.weather-widget .weather-description {
    font-size: 14px;
    margin-bottom: 10px;
}

.weather-widget .weather-high-low {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

.weather-widget .weather-hourly {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: auto; /* Push to bottom */
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 10px;
}

.weather-widget .hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    gap: 5px;
}

.weather-widget .hourly-item img {
    width: 20px;
    height: 20px;
    filter: invert(1); /* Ensure white icons */
}

.weather-widget .hourly-temp { font-weight: bold; }

.widget-footer {
    text-align: right;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

.iphone-apps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns for apps */
    gap: 10px; /* Reduced gap for more apps */
    padding: 15px 15px 0 15px; /* Adjust padding for apps area */
    flex-grow: 1; /* Allow grid to take up available space */
    align-content: start; /* Align rows to the start */
    margin-top: 10px; /* Space between widgets and app grid */
}

.iphone-app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Align icon to top */
    text-align: center;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    height: 80px; /* Fixed height for app icon container */
}

.iphone-app-icon img {
    width: 55px; /* Slightly larger icons */
    height: 55px;
    border-radius: 15px; /* More rounded square for iOS icons */
    margin-bottom: 5px;
    object-fit: cover; /* Ensure images fill the space */
}

.iphone-app-name {
    font-size: 0.8em; /* Slightly smaller font for app names */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 0; /* Remove top margin */
}

.iphone-search-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.2); /* Semi-transparent white */
    border-radius: 15px;
    width: 90%;
    padding: 8px 15px;
    margin: 15px auto; /* Center horizontally below apps */
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    gap: 8px;
}

.iphone-search-bar img {
    width: 16px;
    height: 16px;
    filter: invert(1); /* Ensure white search icon */
}

.iphone-dock {
    background-color: rgba(255, 255, 255, 0.1); /* Frosted glass effect */
    backdrop-filter: blur(20px); /* Stronger blur for dock */
    border-radius: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 15px;
    margin: 0 15px 15px 15px; /* Position at bottom with some margin */
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.iphone-dock-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.iphone-dock-icon img {
    width: 55px; /* Larger icons in dock */
    height: 55px;
    border-radius: 15px;
    object-fit: cover;
}

.iphone-boot-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100; /* Ensure it's on top */
    opacity: 1;
}

.iphone-boot-screen.hidden {
    animation: iphoneFadeOut 1s ease-in-out 3s forwards; /* Use animation similar to main boot screen */
    pointer-events: none; /* Disable interaction once hidden */
}

.iphone-boot-logo {
    text-align: center;
}

.iphone-apple-logo {
    width: 80px;
    height: 80px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"/></svg>') no-repeat center;
    background-size: contain;
    margin: 0 auto 20px;
}

.iphone-loading-bar {
    width: 150px; /* Smaller loading bar for iPhone */
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    overflow: hidden;
}

.iphone-loading-progress {
    width: 0%;
    height: 100%;
    background-color: #fff;
    animation: iphoneLoading 3s ease-in-out forwards; /* Match total duration to fadeOut */
}

@keyframes iphoneLoading {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes iphoneFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.apple-logo-boot {
    width: 80px;
    height: 80px;
    fill: white; /* Ensure the SVG is white */
}

/* Phone Dialer Styles */
.phone-dialer {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background-color: #000; /* Dark background for the dialer */
    color: white;
    font-family: 'SF Pro Text', -apple-system, BlinkMacMacSystemFont, sans-serif;
}

.dialer-display {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 200;
    padding: 20px;
    text-align: center;
    word-wrap: break-word;
    white-space: normal;
    max-height: 150px; /* Limit display height */
}

.dialer-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
}

.keypad-row {
    display: contents; /* Allows buttons to directly participate in the grid */
}

.dialer-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1); /* Light gray for buttons */
    border: none;
    color: white;
    font-size: 28px;
    font-weight: 300;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    -webkit-appearance: none; /* Remove default button styles */
    -moz-appearance: none;
    appearance: none;
    outline: none;
    transition: background-color 0.1s ease;
}

.dialer-button:active {
    background-color: rgba(255, 255, 255, 0.25);
}

.dialer-button span {
    font-size: 10px;
    font-weight: 500;
    margin-top: 2px;
}

.dialer-button:nth-child(1) span { margin-top: 0; } /* No text for '1' */

.dialer-call-button {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.call-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #32CD32; /* Green for call button */
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    transition: background-color 0.1s ease;
}

.call-button:active {
    background-color: #28a745;
}

.call-button img {
    width: 30px;
    height: 30px;
    filter: invert(1); /* Ensure white phone icon */
} 