/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f0e7ff 0%, #e5f1ff 100%);
    min-height: 100vh;
    padding: 20px 0;
}

/* iPhone Frame */
.phone-frame {
    width: 375px;
    height: 812px;
    background-color: #f0f0f0;
    border-radius: 40px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    border: 12px solid #1a1a1a;
    box-shadow: 0 25px 50px -12px rgba(106, 17, 203, 0.4), 0 15px 25px -8px rgba(37, 117, 252, 0.3);
    background: linear-gradient(145deg, rgba(106, 17, 203, 0.05), rgba(37, 117, 252, 0.05));
    transition: all 0.4s ease;
    position: relative;
}

.phone-frame::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(45deg, #6a11cb, #2575fc, #ff9a9e, #fad0c4) border-box;
    border-radius: 44px;
    border: 4px solid transparent;
    -webkit-mask: 
       linear-gradient(#fff 0 0) content-box, 
       linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.7;
    z-index: -1;
    animation: borderGlow 5s ease-in-out infinite alternate;
}

@keyframes borderGlow {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.8; transform: scale(1.02); }
}

.phone-frame:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px -15px rgba(106, 17, 203, 0.4), 0 18px 30px -10px rgba(37, 117, 252, 0.3);
}

/* iframe for app screens */
.phone-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* iOS status bar */
.ios-status-bar {
    height: 44px;
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    color: white;
}

.time {
    font-weight: bold;
}

.status-icons i {
    margin-left: 5px;
}

/* Bottom tab bar */
.bottom-tab-bar {
    height: 84px;
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(106, 17, 203, 0.15);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    width: 60px;
    transition: all 0.3s ease;
}

.tab-item.active {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.tab-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

/* App header */
.app-header {
    margin-top: 44px;
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: linear-gradient(90deg, #5c65e8 0%, #4e8bf5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(92, 101, 232, 0.2);
}

.app-title {
    font-size: 17px;
    font-weight: 600;
}

/* Main container for app content */
.app-container {
    padding: 16px;
    margin-top: 94px;
    margin-bottom: 84px;
    height: calc(100% - 178px);
    overflow-y: auto;
}

/* Item cards */
.item-card {
    background-color: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 4px solid #6a11cb;
    transition: all 0.3s ease;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 17, 203, 0.1);
}

.item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 12px;
}

.item-info {
    flex: 1;
}

.item-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.item-expiry {
    font-size: 14px;
}

.expiry-soon {
    color: #ff9500;
    background: linear-gradient(90deg, #ff9500, #ffcc00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 149, 0, 0.1);
}

.expired {
    color: #ff3b30;
    background: linear-gradient(90deg, #ff3b30, #ff6b58);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 59, 48, 0.1);
}

.fresh {
    color: #34c759;
    background: linear-gradient(90deg, #34c759, #00e676);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(52, 199, 89, 0.1);
}

/* Buttons */
.primary-button {
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
    font-weight: 600;
    width: 100%;
    margin-top: 16px;
    border: none;
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.2);
    transition: all 0.3s ease;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(106, 17, 203, 0.3);
}

.secondary-button {
    background-color: rgba(255, 255, 255, 0.8);
    color: #5c65e8;
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
    font-weight: 600;
    width: 100%;
    margin-top: 10px;
    border: 1px solid rgba(92, 101, 232, 0.2);
    transition: all 0.3s ease;
}

.secondary-button:hover {
    background-color: rgba(255, 255, 255, 1);
    border: 1px solid rgba(92, 101, 232, 0.4);
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    background: linear-gradient(90deg, #6a11cb, #2575fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(106, 17, 203, 0.15);
    background-color: rgba(106, 17, 203, 0.03);
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.form-input:focus {
    border-color: rgba(106, 17, 203, 0.3);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
    outline: none;
}

.form-select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(106, 17, 203, 0.15);
    background-color: rgba(106, 17, 203, 0.03);
    font-size: 16px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a11cb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.form-select:focus {
    border-color: rgba(106, 17, 203, 0.3);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
    outline: none;
}

/* Category tags */
.category-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-right: 6px;
    margin-bottom: 6px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    letter-spacing: 0.3px;
}

.category-dairy {
    background: linear-gradient(135deg, #00c6fb 0%, #005bea 100%);
    color: white;
}

.category-produce {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.category-meat {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.category-frozen {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

/* Settings list */
.settings-list {
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(106, 17, 203, 0.1);
}

.settings-item {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(106, 17, 203, 0.08);
    transition: all 0.3s ease;
}

.settings-item:hover {
    background-color: rgba(106, 17, 203, 0.03);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-label {
    font-weight: 500;
    color: #333;
}

/* Search bar */
.search-bar {
    background: linear-gradient(90deg, rgba(106, 17, 203, 0.05), rgba(37, 117, 252, 0.05));
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    border: 1px solid rgba(106, 17, 203, 0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-bar input {
    border: none;
    background: transparent;
    flex: 1;
    margin-left: 8px;
    font-size: 16px;
    outline: none;
    caret-color: #6a11cb;
    color: #2575fc;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #8e8e93;
    background: radial-gradient(circle at center, rgba(106, 17, 203, 0.03) 0%, rgba(37, 117, 252, 0.01) 70%, transparent 100%);
    border-radius: 20px;
    margin: 20px 0;
    border: 1px dashed rgba(106, 17, 203, 0.15);
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(106, 17, 203, 0.1); }
    70% { box-shadow: 0 0 0 10px rgba(106, 17, 203, 0); }
    100% { box-shadow: 0 0 0 0 rgba(106, 17, 203, 0); }
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Segment control */
.segment-control {
    background-color: rgba(106, 17, 203, 0.1);
    border-radius: 12px;
    display: flex;
    margin-bottom: 16px;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid rgba(106, 17, 203, 0.15);
}

.segment-item {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    color: #6a11cb;
    transition: all 0.3s ease;
    border-radius: 10px;
    font-weight: 500;
}

.segment-item.active {
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(106, 17, 203, 0.2);
    color: white;
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .phone-frame {
        width: 100%;
        height: 650px;
    }
}

/* Screen container for index.html */
.screen-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
    padding: 30px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(106, 17, 203, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
}